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.
Related
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?
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.
I tried to build a simple spring integration project where I get a REST request and convert it to a SOAP request. Something like:
<int-http:inbound-gateway id="rest-inbound-gateway" request-channel="restRequestChannel"
reply-channel="restOutputChannel" supported-methods="POST"
path="/somepath" request-payload-type="com.something.RequestObject">
<int-http:request-mapping consumes="application/json" produces="application/json" />
</int-http:inbound-gateway>
<int:transformer ref="RestToSoapTransformer" method="transform"
input-channel="restRequestChannel" output-channel="transformedChannel"/>
<int-ws:outbound-gateway id="marshallingGateway"
request-channel="transformedChannel" reply-channel="restOutputChannel"
uri="http://localhost:8088/mockSoapBinding" marshaller="marshaller"
message-sender="messageSender"
unmarshaller="marshaller" >
</int-ws:outbound-gateway>
But some informations which are in the REST request need to put to the SAOP envelope header and not the envelope body. Eg.
REST Request:
{
"foo": "foo",
"bar": "bar"
}
And SOAP Request sould be:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<foo>foo</foo>
</soapenv:Header>
<soapenv:Body>
<bar>bar</bar>
</soapenv:Body>
</soapenv:Envelope>
How can I do that? The transformer only create the soap body, and the in an interceptor or header mapper I don't have the original request anymore. Is there any way to do that?
See the documentation.
WS Message Headers
The Spring Integration WebService Gateways will map the SOAP Action header automatically. It will be copied by default to and from Spring Integration MessageHeaders using the DefaultSoapHeaderMapper.
Of course, you can pass in your own implementation of SOAP specific header mappers, as the gateways have respective properties to support that.
Any user-defined SOAP headers will NOT be copied to or from a SOAP Message, unless explicitly specified by the requestHeaderNames and/or replyHeaderNames properties of the DefaultSoapHeaderMapper.
...
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>
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.