SOAP request fails when using oracle Web Services Test Client - oracle

I have a web services developed on Jdeveloper. When i test it using postman it works fine. But when i open oracle web services test client and try the following error:
<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header/>
<S:Body>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns0:Fault xmlns:ns1="http://www.w3.org/2003/05/soap-envelope" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>ns0:Client</faultcode>
<faultstring>Couldn't create SOAP message due to exception: unexpected XML tag. expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {http://myapp/ppp/}GetCustomerElement</faultstring>
</ns0:Fault>
</S:Body>
</S:Envelope>
</S:Body>
</S:Envelope>
What can be the cause?

Related

How to remove unwanted namespaces and change the namespace location in Spring Web Service requests

I am working on a Spring Web services client, which is making a SOAP requests.
The project contains a wsdl file which references 2 versions of xsd files. The issue we are observing is that the generated request includes all the namespaces, even those which are not applicable. Also we want the namespaces to appear in SOAP-ENV. Below are sample actual and expected requests with dummy data.
EmployeeSearchRequest is defined in empService-v1-1.xsd
Actual Request:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
...
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns6:EmployeeSearchRequest xmlns:ns2="http://employee-info.com/emp/xsd/2014/05" xmlns:ns3="http://employee-info.com/emp/common/xsd/2014/09" xmlns:ns4="http://employee-info.com/emp/xsd/2011/04" xmlns:ns5="http://employee-info.com/emp/wsdl/empService-v1-0" xmlns:ns6="http://employee-info.com/emp/wsdl/empService-v1-1">emp1</ns6:EmployeeSearchRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Expected Request:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://employee-info.com/emp/common/xsd/2014/09" xmlns:ns2="http://employee-info.com/emp/wsdl/empService-v1-1">
<SOAP-ENV:Header>
...
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:EmployeeSearchRequest>emp1</ns2:EmployeeSearchRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I could not figure out how can I achieve the expected request format. Could not find solutions online as well.
This is first time I am working on SOAP web service.
Please help.

SOAP UI validates improper fault structure

Can you help me understand why SOAP UI (v4.0.1) validates the below structure even though it should be non compliant to standard schema
<soapenv:Body>
**<code>FOUTNUMMER : RRC073</code>**
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Provider Error Occured.</faultstring>
</soapenv:Fault>
</soapenv:Body>

Salesforce Outgoing message: SOAP response was a nack

I am integrating with an in-house system. I have set up an outgoing message on one object and my web service is seeing the message every time I update a record. My service is sending an true response, but the outgoing message delivery status is showing "SOAP response was a nack".
I have used wireshark to capture the request and the response on my web server. This is what I see:
Request:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv: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">
<soapenv:Body>
<notifications xmlns="http://soap.sforce.com/2005/09/outbound">
<OrganizationId>00D00000000hfNqEAI</OrganizationId>
<ActionId>04k370000004FsYAAU</ActionId>
<SessionId xsi:nil="true"/>
<EnterpriseUrl>https://na31.salesforce.com/services/Soap/c/36.0/00D00000000hfNq</EnterpriseUrl>
<PartnerUrl>https://na31.salesforce.com/services/Soap/u/36.0/00D00000000hfNq</PartnerUrl>
<Notification>
<Id>04l370000006ISGAA2</Id>
<sObject xsi:type="sf:Opportunity" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
<sf:Id>00637000007h5uwAAA</sf:Id>
<sf:AccountId>00100000003Qy45AAC</sf:AccountId>
<sf:Name>Andrew Test</sf:Name>
<sf:OwnerId>00500000006pE7kAAE</sf:OwnerId>
<sf:StageName>Unqualified</sf:StageName>
</sObject>
</Notification>
</notifications>
</soapenv:Body>
</soapenv:Envelope>
Response: (HTTP/1.1 200 OK)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-NV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.sforce.com/2005/09/outbound"><SOAP-ENV:Body><Ack>true</Ack></SOAP-ENV:Body></SOAP-ENV:Envelope>
Can anyone see what is causing the response to fail?
Your response message doesn't conform to the format described by the WSDL, it should be
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<notificationsResponse xmlns="http://soap.sforce.com/2005/09/outbound">
<Ack>true</Ack>
</notificationsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
note the additional notificationsResponse element, and the fact that this is in the OM xml namespace.

weblogic Ws-security policy vs oasis policy

We are trying to configure ws-security on a webservice deployed on Weblogic 10.3.6: the purpose is to permit the execution of the ws only if authenticated.
So, we created an user ("dummy") into the default weblogic realm and communicated the credentials to who develops the client of this webservice.
He has released a test Envelope running by SOAP-UI
<soapenv:Envelope xmlns:sch="http://com.webservices.amm.standalone.key.provider/schema.xsd" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-2">
<wsse:Username>dummy</wsse:Username>
<wsse:Password Type="**http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest**"><!-- digested password --></wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"><!-- encoding type --></wsse:Nonce>
<wsu:Created>2015-06-24T14:42:48.749Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<sch:searchKeyReq>
<sch:KeyProviderInput>
<!--Here input attributes:-->
</sch:KeyProviderInput>
</sch:searchKeyReq>
</soapenv:Body>
</soapenv:Envelope>
which response is
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body><SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">**SOAP-ENV:MustUnderstand**</faultcode>
<faultstring>MustUnderstand headers:[{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood</faultstring>
</SOAP-ENV:Fault></S:Body></S:Envelope>
Obviously, I think, it depends by no configuration on ws-policy of the webservice.
So the questions are:
1) which is the policy we must associate to our webservice by Administration Console or by weblogic #Policy annotation in correspondence of oasis policy we see into the soapenv:Header tag>?
2) the "dummy" user must have some specific role?
Thanks in advance
You can simply add below line to your web service class:
#Policy(uri = "Wssp1.2-2007-Https-UsernameToken-Plain.xml", attachToWsdl=true)
By means of this policy you tell the clients that send their username and password (plain text). There are some other policy that you can choose in order to send encrypted password such as Digest.
You can choose this policy also from weblogic console.
And about role of the user, according to my knowledge, defining a new user in security realm just works really well, but in order to manage roles and permissions there should be some roles.

Spring-ws SOAP 404 error

i did a tutorial after this -> http://java.dzone.com/articles/spring-ws-how
when i go to url http://localhost:8080/myService/services/MemberDetailsRequest.wsdl , i get the static wsdl file.. but when i use SoapUI to import in the wsdl file and then test it.. i only get 404 error, any1 has a solution to that?
any suggestions, why i can't get any responses with soapUI?
Check to make sure that your #PayloadRoot initializers are correct. My "localpart" definition did not match the element name in the XSD. here is how my Java class looks now:
#PayloadRoot(localPart = "GetLoginRequest", namespace = "<namespace>")
And here is the XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="<namespace>" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="<namespace>">
<xsd:include schemaLocation="user-types.xsd"></xsd:include>
<xsd:element name="GetLoginRequest" type="loginRequest"></xsd:element>
<xsd:element name="GetLoginReply" type="loginReply"></xsd:element>
</xsd:schema>
Make sure SoapUI follows your URL mapping.
In my case, SoapUI did not automatically append ".wsdl" at the end.
in my web.xml:
<servlet-mapping>
<servlet-name>Hello</servlet-name>
<url-pattern>/services/HelloPersonService.wsdl</url-pattern>
</servlet-mapping>
In Soap UI, the ".wsdl" was not there. Just add it manually in the address-bar like thing in Soap UI and proceed with your test.
PayloadRoot namespace and schema namespace should be same
Do a component scan on the package that contains all the endpoints. This worked for me. In memberservice-servlet.xml include the following
<context:component-scan base-package="org.bk.memberservice.endpoint" />

Resources