I have a web service deployed on tomcat server and also have generated a wsdl file for the same.
Later I generated a new soap project through wsdl, and executed a soap request to the server.
The problem here is at the server side, unmarshalling of xml is failing because of namespace prefix for "InputData" and "CCNA" are wrong. Currently it is cfa.
According to java code, The namespaces for InputData is xs and CCNA is bim.
So, if I modify the soap request, unmarshall is fine on server side.
So, where is the issue ? WSDL generation or anywhere else in JAX WS ?
I should not be modifying my soap request.
SOAP request :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cfa="http://cfa.ni.ctl.com/" xmlns:bim="http://www.qwest.com/XMLSchema/BIM" xmlns:xs="http://www.qwest.com/XMLSchema">
<soapenv:Header/>
<soapenv:Body>
<cfa:getCFACircuit>
<!--Optional:-->
<CFACircuitRequest>
<bim:RequestId>123</bim:RequestId>
<bim:WebServiceName>123</bim:WebServiceName>
<bim:RequestPurpose>123</bim:RequestPurpose>
<bim:AuthorizationInfo>
<!--Optional:-->
<bim:ApplicationId>123</bim:ApplicationId>
<!--Optional:-->
<bim:UserId>123</bim:UserId>
<!--Optional:-->
<bim:Userid>123</bim:Userid>
<bim:Password>123</bim:Password>
</bim:AuthorizationInfo>
<!--Optional:-->
<bim:TargetSchemaVersionUsed>
<!--Optional:-->
<bim:TargetXSDName>123</bim:TargetXSDName>
<!--Optional:-->
<bim:MajorVersionNumber>123</bim:MajorVersionNumber>
<!--Optional:-->
<bim:MinorVersionNumber>123</bim:MinorVersionNumber>
</bim:TargetSchemaVersionUsed>
<!--Optional:-->
<bim:TimeOutSecond>123</bim:TimeOutSecond>
<!--Optional:-->
<bim:SendTimeStamp>123</bim:SendTimeStamp>
<cfa:InputData>
<cfa:CCNA>123</cfa:CCNA>
<xs:CableKey>
<!--Optional:-->
<xs:LowUnit>123</xs:LowUnit>
<!--Optional:-->
<xs:HighUnit>123</xs:HighUnit>
<!--Optional:-->
<xs:CableId>123</xs:CableId>
<!--Optional:-->
<xs:CableSubPath>123</xs:CableSubPath>
<!--Optional:-->
<xs:CLLIALocation>123</xs:CLLIALocation>
<!--Optional:-->
<xs:CLLIZLocation>123</xs:CLLIZLocation>
</xs:CableKey>
</cfa:InputData>
</CFACircuitRequest>
</cfa:getCFACircuit>
</soapenv:Body>
</soapenv:Envelope>
XML annotation for Input data on server is :
#XmlElement(name = "InputData", namespace = "http://www.qwest.com/XMLSchema", required = true)
I would guess your XML request is incorrect. Please try to validate first your request against XML schema.
It does not matter which namespace prefix you use, but you need to make sure the XML elements match to the appropriate namespace.
Ajay,
your annotation is:
#XmlElement(name = "InputData", namespace = "http://www.qwest.com/XMLSchema", required = true)
But in your XML request the element InputData belongs to the namespace "http://cfa.ni.ctl.com/".
You need to fix the annotation.
Related
I have a business scenario where I have to invoke a client SOAP service that uses additional SOAP header parameters using Oracle SOA Suite 12c. When I test the web service independently via SOAP UI it shows below schema as input-
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://xmlns.client.org/Schema/Common/1.0/Common.xsd" xmlns:user="http://xmlns.uppcl.org/Schema/UserAccess/2.0/UserAccess.xsd">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.demo-open.org/wss/2004/01/demo-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.demo-open.org/wss/2004/01/demo-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>DemoUser</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Demo#123</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<com:TransactionReference>
<com:SourceSystemId>TXNSYSID</com:SourceSystemId>
<com:TxID>0403216376127836</com:TxID>
<!--Optional:-->
<com:BusinessID>DTUIQS</com:BusinessID>
</com:TransactionReference>
</soapenv:Header>
<soapenv:Body>
<user:CheckUserRequest>
<user:UserId>USER_ID</user:UserId>
</user:CheckUserRequest>
As we can see additional header elements wsse:Security > UsernameToken > Username/Password , TransactionReference > SourceSystemId / TxID / BusinessID as XML node.
Further, I configured the SOAP adapter in my SOA composite but it has only one input argument UserId. Now I am not able to figure out how can I pass additional headers (username/password, SourceSystemId / TxID / BusinessID ) in SOA Header for target web service invocation in my SOA composite.
add this snippet to omitt default wsa tags
<binding.ws> <property name="oracle.soa.ws.outbound.omitWSA" type="xs:boolean" many="false" override="may">true</property> </binding.ws>
I am using an automation process presently.i have configured my service provider and identity provider by using the Ui successfully it is reflecting to database in these case my db is h2. But now i am trying to create the service provider and identity provider by using the webservice api of wso2is and testing by using soapUi.
My soap request is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://dto.saml.sso.identity.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:addRPServiceProvider>
<!--Optional:-->
<xsd:spDto>
<!--Optional:-->
<xsd1:assertionConsumerUrl>http://localhost:8080/travelocitysoap.com/home.jsp</xsd1:assertionConsumerUrl>
<!--Optional:-->
<xsd1:certAlias>wso2carbon.cert</xsd1:certAlias>
<!--Optional:-->
<xsd1:doSignAssertions>true</xsd1:doSignAssertions>
<!--Optional:-->
<xsd1:doSignResponse>true</xsd1:doSignResponse>
<!--Optional:-->
<xsd1:doSingleLogout>true</xsd1:doSingleLogout>
<!--Optional:-->
<xsd1:issuer>travelocitysoap.com</xsd1:issuer>
<!--Optional:-->
<xsd1:nameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</xsd1:nameIDFormat>
</xsd:spDto>
</xsd:addRPServiceProvider>
</soapenv:Body>
</soapenv:Envelope>
which successfully created the application and in the wso2is console the response is added successfully service provider of travelocitysoap.com.but when i am trying to see my service provider in dashboard it is not visibe to me.and it is not reflecting to the database which i am using as h2.
But when i am running the application it is successfully running.But i dont know where my service provider is storing in database of which table.
Where to add Service Provider ID so that I can view in the database with its name. Also please help me with the approach to automate Identity Provider.What am i misinterpreting.
Thanks in advance,
Vijay.
Service provider is stored in registry db, You can view your service providers by navigating to /_system/config/repository/identity/SAMLSSO in admin console.Properties tab will have all the properies of particular SP.
If you want to view the SP in admin console follow the steps given in [1]
1.https://shivabalachandran.wordpress.com/2015/03/02/quick-note-4-creating-a-sso-service-provider-through-admin-services-wso2-is-admin-services-sso/
i have a web service client which uses axis2 1.6.1, xmlbeans. It works fine.
Now, i want to create a string of soap request message (not only a xml string but also a soap string) from request object.
Please help.
(using jaxb or cxf are not options for this project)
Ok, i worked it out. After you have xmlbean object, just do string concatenate between soap envelope and xmlObject.toXML().
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.qwest.com/XMLSchema" >
<soapenv:Header/>
<soapenv:Body>
+ xmlObject.toXML()
+ </soapenv:Body>
</soapenv:Envelope>
I am very new to Mule ESB. I want to expose a Mule flow as an WebService to an external applicaton. How to set the request(payload) structure in the wsdl exposed by mule?
Am using CFX for it.
Currently my request while loading WSDL in SoapUI looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sup="http://support.cxf.module.mule.org/">
<soapenv:Header/>
<soapenv:Body>
<sup:invoke>
<sup:arg0>?</sup:arg0>
</sup:invoke>
</soapenv:Body>
</soapenv:Envelope>
Actual request expected to be is as follows:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://pcom.orga.com/pc/webservices/messages/v1">
<soapenv:Header/>
<soapenv:Body>
<v1:searchOfferRequest>
<searchInput>
<status>RELEASED</status>
</searchInput>
</v1:searchOfferRequest>
</soapenv:Body>
</soapenv:Envelope>
Have a look at Mule documentation for exposing a SOAP service in Mule, specifically look for the section "Creating a WSDL First JAX-WS Service" which has an example of what you are looking for.
HTH
I try to test some paypal services in soapUi whith this location https://svcs.sandbox.paypal.com/AdaptivePayments/Pay.
I generate my user/password/signature in sandbox environnement. I put this request with values generated :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ap="http://svcs.paypal.com/types/ap">
<soapenv:Header>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents">
<Username>email#test.fr</Username>
<Password>1378372813</Password>
<Signature>AUM6025PrUAhjJbx1wnRiHOOgrv4AQc1xL50M13g83QoPe4uaxaBQJR.</Signature>
<Subject />
</Credentials>
</RequesterCredentials>
</soapenv:Header>
<soapenv:Body>
<ap:PayRequest>
<requestEnvelope>
<errorLanguage>en_US</errorLanguage>
<!--You may enter ANY elements at this point-->
</requestEnvelope>
<actionType>PAY</actionType>
<cancelUrl>cancelurl</cancelUrl>
<currencyCode>EUR</currencyCode>
<receiverList>
<!--1 or more repetitions:-->
<receiver>
<amount>2</amount>
<!--Optional:-->
<email>test#test.fr</email>
<!--Optional:-->
<paymentType>PERSONAL</paymentType>
</receiver>
</receiverList>
<returnUrl>urlReturn</returnUrl>
</ap:PayRequest>
</soapenv:Body>
</soapenv:Envelope>
The response is :
2013-09-05T02:57:40.738-07:00
Failure
fb8c36a4b879d
6941298
520003
PLATFORM
Application
Error
Application
Authentication failed. API credentials are incorrect.
Can you tell me please if I forget soap header parameters?
Regards.
Stevens
Instead of giving the authentication details in the soap header try giving them as http headers. See this for adding custom headers to request