Why are my entities disapearing after deploy? - entity-framework

I created an OData service for a couple of our entities, and on my developer machine (WinXP), everything works like it should, this is what I get when accessing the service:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://localhost:2332/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
<collection href="Client">
<atom:title>Client</atom:title>
</collection>
<collection href="Vehicle">
<atom:title>Vehicle</atom:title>
</collection>
<collection href="Contact">
<atom:title>Contact</atom:title>
</collection>
</workspace>
</service>
Now after I deployed that service to a testserver (Win2K3), all my entities are gone:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://dev-cont2011b/ContactOData/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
</workspace>
</service>
There are no error messages, nothing in the event log. My connections string is ok (I tested this with a simple test.aspx page which fetches something out of the database and shows it on the page ==> this works).
When I manually enter the url for one of the entities (Client), this is what I get:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="nl-BE">Resource not found for the segment 'Client'.</message>
</error>
The .NET Framework 3.5 is installed on that server. I ran all the updates.
I've been banging my head on this one for the last couple of hours. I don't know what else I can do or test.
Any suggestions?

The solution was to install this update:
ADO.NET Data Services Update for .NET Framework 3.5 SP1 for Windows Server 2003, Windows XP, Windows Vista and Windows Server 2008
Apparently, this one isn't included into windows update by default. You have to run it manually.
This was needed because I changed the default InitializeService method so it takes a DataServiceConfiguration in stead of an IDataServiceConfiguration:
public static void InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
config.DataServiceBehavior.MaxProtocolVersion = System.Data.Services.Common.DataServiceProtocolVersion.V2;
config.SetEntitySetPageSize("*", 20);
}
This is needed if you want to enable server side paging (SetEntitySetPageSize) (amongst others).

New try:
It is a RESX problem
<message xml:lang="nl-BE">Resource not found for the segment 'Client'.</message>
It is trying to lookup the nl-BE translation for the name Client.

Related

Wildfly 13.0.0.Final error UT005014: Failed to parse request: io.undertow.util.BadRequestException: UT000165: Invalid character ä in request-target

We have recently migrated and deployed our application.EAR (API's) packages in wildfly 13.0.0.Final from GlassFish 3 in Linux environment. While testing application api's its not supporting scandic characters and giving below error (Error copied from server.log from wildfly). But the same test request working fine with the application api's deployed in GlassFish server. I tried to study so many blogs related to wildfly but could not get any solutions. Could some one help here please.
I tired below setting changes in standalone.xml file to set the charset to UTF-8, but its not helped.
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" url-charset="UTF-8"/>
<servlet-container name="default" default-encoding="UTF-8">
2018-07-13 17:06:45,189 DEBUG [io.undertow.request.io] (default I/O-4) UT005014: Failed to parse request: io.undertow.util.BadRequestException: UT000165: Invalid character ä in request-target
at io.undertow.server.protocol.http.HttpRequestParser.handleQueryParameters(HttpRequestParser.java:523)
at io.undertow.server.protocol.http.HttpRequestParser.beginQueryParameters(HttpRequestParser.java:486)
at io.undertow.server.protocol.http.HttpRequestParser.handlePath(HttpRequestParser.java:410)
at io.undertow.server.protocol.http.HttpRequestParser.handle(HttpRequestParser.java:248)
at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:187)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:147)
at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:93)
at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:52)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:291)
at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:286)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.nio.QueuedNioTcpServer$1.run(QueuedNioTcpServer.java:131)
at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:612)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:479)
Below is the request XML which we are sending to application deployed in both Wildfly and GlassFish
<SOAP-ENV:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<StartHeader SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0" xmlns="http://www.openuri.org/2002/04/soap/conversation/">
<callbackLocation>http://TESTUI</callbackLocation>
</StartHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ListAttributeValues xmlns="http://www.openuri.org/" xmlns:v001="http://xml.comptel.com/NIMS/address/listAttribteValuesRequest/v002" xmlns:v0011="http://xml.comptel.com/NIMS/address/v002">
<listAttributeValuesRequest xsi:schemaLocation="http://xml.comptel.com/NIMS/address/listAttributeValuesRequest/v002 http://xml.comptel.com/NIMS/address/listAttributeValuesRequest/v002" xmlns="http://xml.comptel.com/NIMS/address/listAttributeValuesRequest/v002" xmlns:spec="http://xml.comptel.com/NIMS/address/v002" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spec:searchItemList>
<spec:attribute>
<spec:name>district</spec:name>
<spec:value>Jär</spec:value>
</spec:attribute>
</spec:searchItemList>
<spec:attributeName>district</spec:attributeName>
<spec:maxItems>100</spec:maxItems>
</listAttributeValuesRequest>
</ListAttributeValues>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Finally i managed to fix the problem with help of JBossDevelopers community
I don't think it's the contents of SOAP message that is the problem, but the URI that is used to touch the web service. Problem can be fixed using any of the below option. Option 2 will be recommended for latest wildfly versions where undertow subsystem introduced.
By adding the following Java option to startup script :
-Dorg.wildfly.undertow.ALLOW_UNESCAPED_CHARACTERS_IN_URL=true
or we can set the allow-unescaped-characters-in-url="true" and url-charset="windows-1252" flags in the undertow subsystem in standalone.xml file.
I think these options were added as part of the undertow:6.0 schema as attributes of the https-listener and http-listener elements.
See here:
wildfly/wildfly-undertow_6_0.xsd at master · wildfly/wildfly · GitHub
An example configuration:
wildfly/undertow-6.0.xml at master · wildfly/wildfly · GitHub

Error calling container "containername": Session 'defaultKieSession' not found on container

I want to call drools via kie server per REST-Call.
I created a container with runtime strategy "Singleton" without Kie Basis Name and without Kie Session Name.
Here is my rest call:
- URL: http://10.199.0.211:8080/kie-server-6.5.0.Final-ee7/services/rest/server/containers/instances/test1
- Authorization: basic
- Header: Content-Type: application/xml
Body:
<batch-execution lookup="defaultKieSession">
<insert out-identifier="message" return-object="true" entrypoint="DEFAULT">
<de.salt.d4s.test2.test2.input>
<order>1</order>
</de.salt.d4s.test2.test2.input>
</insert><fire-all-rules></fire>
</batch-execution>
I get this result:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="FAILURE" msg="Error calling container test1: Session
'defaultKieSession' not found on container 'test1'."/>
I tried to do this with a "kie session name" in process-configuration but got the same error.
What can I do to solve this?
Thank you!
Michael
Check if, in the directory resources/META-INF, the file kmodule.xml contains a default ksession, if not you can place it:
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<kbase name="myBase" default="true">
<ksession name="mySession" type="stateless" default="true" clockType="realtime"/>
<ksession name="mySession2" default="true" clockType="realtime"/>
</kbase>
</kmodule>
For more details about the xml values you can take a look here:
https://docs.jboss.org/drools/release/6.2.0.CR3/drools-docs/html/KIEChapter.html#d0e1533

Having no success calling SetPolicies via SOAP SSRS 2010 API

I'm having a heck of a time calling SetPolicies() (API ref) using the 2010 SSRS WSDL (on SQL Server 2008R2 SSRS Server). When I POST with the following payload, I get a 200 response, a well formed SOAP response with an empty body, but no policy actually created for the given folder.
I'm making other calls successfully, so I'm not worried about auth problems. Additionally, I've made the same calls via Powershell with success.
I'm trying to use the raw SOAP API (called from Ruby actually)...anybody have any suggestions on what to try next?
Here's my XML:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:SetPolicies>
<tns:ItemPath>/mydir</tns:ItemPath>
<tns:Policies>
<tns:groupUserName>mydomain\someuser</tns:groupUserName>
<tns:roles>
<tns:role>
<tns:name>Content Manager</tns:name>
<tns:description>stuff</tns:description>
</tns:role>
<tns:role>
<tns:name>Browser</tns:name>
<tns:description>stuff here too</tns:description>
</tns:role>
</tns:roles>
</tns:Policies>
</tns:SetPolicies>
</env:Body>
</env:Envelope>
Solved. I was able to catch the POST powershell is using (via wireshark) and look at the XML...the tags are identical, except for casing...
Looks like the reportServer API is sensitive to the case of the XML tags...when POSTing this, I get a 200, and the policies are actually set:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:SetPolicies>
<tns:ItemPath>/mydir</tns:ItemPath>
<tns:Policies>
<tns:GroupUserName>mydomain\someuser</tns:groupUserName>
<tns:Roles>
<tns:Role>
<tns:Name>Content Manager</tns:name>
<tns:Description>stuff</tns:description>
</tns:Role>
<tns:Role>
<tns:Name>Browser</tns:name>
<tns:Description>stuff here too</tns:description>
</tns:Role>
</tns:Roles>
</tns:Policies>
</tns:SetPolicies>
</env:Body>
</env:Envelope>

shindig error: At least 1 ModulePrefs is required

I have Shindig 2.0.2 server running. When I'm trying to render the following local gadget spec XML:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Calendar">
<Require feature="opensocial-0.7" />
</ModulePrefs>
<Content type="url" href='../../Base/content/calendar/index.html'>
</Content>
</Module>
I get this error:
At least 1 ModulePrefs is required.
Does anyone knows this error?
Also when I run my server localy, there is no problem. The error occurs only when my app and Shindig are deployed on cloud (under https).
Thanks!
The problem was that Shindig got the SAML redirection HTML page so it could not be parsed correctly.

How change name in WSDL generated by Zend_Soap_AutoDiscover

I am trying connecting PHP soap server with client written in C#.
WSDL is created in that way:
$autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
$autodiscover->setClass('Soap_Service1');
$autodiscover->handle();
then I receive:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.xx.de/soap/version/1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.xx.de/soap/version/1"
name="Soap_Services1"
>
this 'name="Soap_Services1"' attribute parsed in C# looks ugly (Services.Soap_Services1Service). Of course name is connected with ServiceBinding and PortType. Is there any way to change it without manually hacking zend library?
Yes. Just rename your service class ;)
$autodiscover->setClass('CoolServiceName');
will give you
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.xx.de/soap/version/1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.xx.de/soap/version/1"
name="CoolServiceName"
>
Since you're using the autodiscover / magical soap service creator, you can't override the names it creates as-is.
If you want to do this you can extend Zend_Soap_AutoDiscover and implement your own setClass method that uses your own name choice while generating the wsdl.
All you need to do is rename your service class (the one set by the setClass() call) and you're good.