Setting Schema Structure for Proxy Service(CFX) exposed using Mule ESB - soap

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

Related

Oracle SOA Suite 12c invoke external service with additional SOAP headers

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>

How to link saml service provider(addRPServiceProvider) and application in WSO2 IS?

Created an application with this soap call createApplication()
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://model.common.application.identity.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:createApplication>
<xsd:serviceProvider>
<xsd1:applicationName>travelocity.com</xsd1:applicationName>
<xsd1:description>SaMLApp</xsd1:description>
</xsd:serviceProvider>
</xsd:createApplication>
Added a service provider with this soap call addRPServiceProvider()
<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>
<xsd:spDto><xsd1:assertionConsumerUrl>http://localhost:8080/travelocity.com/home.jsp</xsd1:assertionConsumerUrl>
<xsd1:doSignAssertions>true</xsd1:doSignAssertions>
<xsd1:doSignResponse>true</xsd1:doSignResponse>
<xsd1:doSingleLogout>true</xsd1:doSingleLogout>
<xsd1:issuer>sophos.com</xsd1:issuer>
<xsd1:nameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</xsd1:nameIDFormat>
<xsd1:useFullyQualifiedUsername>true</xsd1:useFullyQualifiedUsername>
</xsd:spDto>
</xsd:addRPServiceProvider>
Now how should I link those by calling updateApplication()? What should be the attributes of update application soap call? I referred this, but could not figure out the linking part in updateApplication().
Note: I can create these on WSO2 IS management console web UI. I could not create them through API calls.
SAML application will be added as an inbound authentication configuration of the Service Provider. So when you call updateApplication method, use the issuer name that you used to create the SAML application (travelocity.com in your case) as the inboundAuthKey in inboundAuthenticationConfig section. If you need a code sample please follow this.

create soap request string with xmlbeans and axis2

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>

WSO2 API Manager: Fault message schema (xsd)

WHat is the schema defintion of the fault message when a service on the WSO2 API Managers fails. For example the services has the status blocked, invoking this service, WSO2 replies with an proper SOAP-Fault message. What is the schema (xsd) defintition of the am:fault element?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://foobar.nl/foobar">
<soapenv:Header/>
<soapenv:Body>
<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>700700</am:code>
<am:message>API blocked</am:message>
<am:description>This API has been blocked temporarily. Please try again later or contact the system administrators.</am:description>
</am:fault>
</soapenv:Body>
</soapenv:Envelope>
A documentation request is created to WSO2 to update the documentation; https://wso2.org/jira/browse/DOCUMENTATION-866
The default schema is,
<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>ERROR_CODE</am:code>
<am:message>ERROR_MESSAGE</am:message>
<am:description>ERROR_DESCRIPTION</am:description>
</am:fault>
You can customize the fault format through sequences.

Paypal Soap request : How to test a serviece in soapui with good header parameters?

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