How to do a JAX-WS SOAP Web Service call - web-services

Can you please let me know how to do a Java SOAP webservice (JAX-WS) call. For example , I want to send below headers to the url https://example.com/eai_enu/WSSOAP=1 and get the response. Sharing an example code will be really helpful. Thank you in advance.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://siebel.com/WebService">
<soapenv:Header>
<UsernameToken xmlns="http://siebel.com/webservices">XXXXXXX</UsernameToken>
<PasswordText xmlns="http://siebel.com/webservices"></PasswordText>
<SessionType xmlns="http://siebel.com/webservices">Stateless</SessionType>
</soapenv:Header>
<soapenv:Body>
<web:QuerySR_Input>
<web:SRNum>450545194</web:SRNum>
</web:QuerySR_Input>
</soapenv:Body>
</soapenv:Envelope>

Related

WSO2 ESB : how to retrive the Carbon Applications List

for monitoring purpose I was looking for a way, possibly via JMX or SNMP, to retrieve the Carbon Applications List and for each one of those the version.
I googled and read the docs but wasn't able to find anything
Any idea ?
TIA
Max
You can view the list or carbon apps deployed by calling admin services.
To get the list of carbon apps you should invoke ApplicationAdmin admin service.
Admin Service URL: https://localhost:9443/services/ApplicationAdmin
Sample Request Payload:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mgt="http://mgt.application.carbon.wso2.org">
<soapenv:Header/>
<soapenv:Body>
<mgt:listAllApplications/>
</soapenv:Body>
</soapenv:Envelope>
Sample Response Payload:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:listAllApplicationsResponse xmlns:ns="http://mgt.application.carbon.wso2.org" xmlns:ax21="http://mgt.application.carbon.wso2.org/xsd">
<ns:return>ContainerAPICompositeApplication_1.0.0</ns:return>
<ns:return>SalesforceCompositeProject_1.0.0</ns:return>
</ns:listAllApplicationsResponse>
</soapenv:Body>
</soapenv:Envelope>
Make sure you pass in the authenticated session ID when making the request. You can find more details on this at : http://itsmaheeka.blogspot.com/2016/06/wso2-admin-services.html

How to pass "complex" multiple parts params as SOAP Request to Mule SOAP Client

I would like to know how pass complex params to Mule SOAP Client, in a simple form, similar to Web Service Consumer component. I can't to use component because the Web Service has several parts and it does not work with n parts.
I tried to do like this: https://docs.mulesoft.com/mule-user-guide/v/3.7/consuming-web-services-with-cxf but does not clear how to make input complex params.
I am using Mule CE 3.7.
In SoapUI, the envelop request is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.abcde.com">
<soapenv:Header/>
<soapenv:Body>
<ser:obterCliente>
<user>name.surname</user>
<password>xxxxx</password>
<encryption>0</encryption>
<parameters>
<!--Optional:-->
<codigoCli>1</codigoCli>
</parameters>
</ser:obterCliente>
</soapenv:Body>
</soapenv:Envelope>
Is there any example about how to pass complex params to SOAP in Mule?

Websphere Web Service Has Different Namespaces On Different Deployments

I have a java webapp that exposes several webservice endpoints that appear to be behaving slightly differently under different deployments.
Were using IBM Websphere 6.1 in all environments.
The namespace on the requests that the service expects differs whether I deploy the ear locally or on the test env - i.e.
Test Env Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:look="http://com.XXXX.bi/lookup">
<soapenv:Header>
<look:Password>XXXXX</look:Password>
<look:Username>XXXXX</look:Username>
</soapenv:Header>
<soapenv:Body>
<look:Lookup>
<Role>Admin</Role>
<ID>AB1234</ID>
<Name>Bob Smith</Name>
<DOB>1901-01-01</DOB>
</look:Lookup>
</soapenv:Body>
</soapenv:Envelope>
Local Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:look="http://com.XXXX.bi/lookup">
<soapenv:Header>
<look:Password>XXXXX</look:Password>
<look:Username>XXXXX</look:Username>
</soapenv:Header>
<soapenv:Body>
<look:Lookup>
<look:Role>Admin</look:Role>
<look:ID>AB1234</look:ID>
<look:Name>Bob Smith</look:Name>
<look:DOB>1901-01-01</look:DOB>
</look:Lookup>
</soapenv:Body>
</soapenv:Envelope>
Both the services on each environment function correctly and in the same manner.
The WSDLs are both identical.
I'm pretty sure this is going to end up being a Websphere config issue as I'm deploying the same ear in both circumstances, but I cant spot any differences between the envs.
Anyone got any ideas what I would need to change?
Thanks

How can I add WSSE Header to my Web Service Client?

I want to add wsse Security header to my web service client on ASP 3.5. I test the web service from SoapUI using this Soap Envelope and get an answer:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:comp="http://myCompany.org.tr"> <soapenv:Header xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
<wsse:Username>MyUsername</wsse:Username>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
(Body Info.)
</soapenv:Body>
</soapenv:Envelope>
I want to create this envelope through classic Web Service Reference which created by Visual Studi 2012. Which class should I use to add Username Info to my envelope?
Thank you John, and Ladislav.
Turns out that you should add the header via web.config file to get properly ordered SOAP message. Otherwise .Net tries to nest your code with its own capsulation (even you dont ask for it), and sends some rubbish as a result.

Coldfusion Web Service Response Problem

I have a problem with the Web Service I recently developed.
The problem is about the Web Service response. More precisely sometimes the Web Service sends back the following response:
<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>
<ns1:GetConstants2Response soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://usermanagerwstest">
<GetConstants2Return xsi:type="ns2:CFComponentSkeleton" xmlns:ns2="http://rpc.xml.coldfusion"/>
</ns1:GetConstants2Response>
</soapenv:Body>
</soapenv:Envelope>
Instead the correct response (that sometimes shows up in an intermittent way) is reported below:
<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>
<ns1:GetConstants2Response soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://usermanagerwstest">
<GetConstants2Return xsi:type="ns1:Constants2">
<BooleanTypeFalse xsi:type="xsd:string">0</BooleanTypeFalse>
<BooleanTypeTrue xsi:type="xsd:string">1</BooleanTypeTrue>
<GenderFemale xsi:type="xsd:string">F</GenderFemale>
<GenderMale xsi:type="xsd:string">M</GenderMale>
<LanguageEnglish xsi:type="xsd:string">inglese</LanguageEnglish>
<LanguageItalian xsi:type="xsd:string">italiano</LanguageItalian>
</GetConstants2Return>
</ns1:GetConstants2Response>
</soapenv:Body>
</soapenv:Envelope>
Where does the CFCComponentSkeleton comes from?
I thank everybody in advance.
It sounds like perhaps the method was missing. When you hit a CFC and don't pass a method, you get the descriptor - a HTML view of the CFC methods. When you do that with ?wsdl in the URL, it should send the WSDL back. But maybe something is getting in the way. Maybe check your web server logs and see if something odd was passed in the URL. Also look into adding some logging within the CFC as well.