salesforce soap api in soapui - soap

I am trying to consume my service class of salsforce SOAP API in SOAPUI.
Getting the error
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>'false' is not a valid value for the enum 'LogCategory'</faultstring>
</soapenv:Fault>
What should be specific value in
<pay:categories>
<pay:category>false</pay:category>
<pay:level></pay:level>
</pay:categories>
<pay:debugLevel></pay:debugLevel>

from this page it looks like pay:category has to be one of
Db
Workflow
Validation
Callout
Apex_code
Apex_profiling
All

Related

Log SOAP Envelop in message flow of Proxy in OSB

Is there a way to see te entire SOAP Envelop while developing a proxy message flow on OSB? I was thinking about using a Log action, but envelope is not a context variable. Is there a way to build it? Thx.
It is true that SOAP envelope is not a context variable when a SOAP message reaches Proxy.
You can rebuild the SOAP Envelope using following expression but change the namespace according to SOAP version. Assign it to a variable and log it after
For v1.2
<env:Envelope xmlns:env="https://www.w3.org/2003/05/soap-envelope">
<env:Header>
{$header/*}
</env:Header>
<env:Body>
{if ($fault) then ($fault) else ($body/*)}
</env:Body>
</env:Envelope>

How to call soap web service from camel rest java DEL

I am trying to call soap web service from camel rest, from java DSL. but getting server error with 500 response code.
I will receive call from a rest with json data and i have to make call to a third party soap service also i need to process the soap response and send back the response in json formate.
here is my code
{
String getCustomerDetailsurl="http://<serverip>/webservice/Service.asmx?op=GetClientDetail&bridgeEndpoint=true";
rest("/customers")
.description("Aviva Mobile sales customer service")
.consumes("application/json")
.produces("application/json")
.post().type(ClientRequest.class) // incomming request data
.route()
.from("direct:start")
//.setHeader(Exchange.HTTP_METHOD, constant("POST"))
.process(new CustomerProcessor()).marshal().xstream()
.to(getCustomerDetailsurl);
Error
org.apache.camel.http.common.HttpOperationFailedException: HTTP operation failed invoking http://<serverip>/webservice/Service.asmx?op=GetClientDetail with statusCode: 500
at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:239) ~[camel-http-2.17.5.jar:2.17.5]
at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:161) ~[camel-http-2.17.5.jar:2.17.5]
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) ~[camel-core-2.17.5.jar:2.17.5]
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145) ~[camel-core-2.17.5.jar:2.17.5]
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77) ~[camel-core-2.17.5.jar:2.17.5]
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468) ~[camel-core-2.17.5.jar:2.17.5]
}
You have to look at Server side for what actual error is.
You may use some tool like tcp monitor (tcpMon) to see exactly what you send and what you get back.
Actually, To use SOAP service it is much better to use SOAP client, rather than raw call through http. Take a look at Camel-CXF component. Then create a CXF endpoint and use it uri in your .to({cxfEndpointUri}). CXF will do all SOAP work for you. Maybe you will need to make a little work in its interceptors, like authorization if Server requires it.
P.S. In your code what kind of Exchange.body your CustomerProcessor produces? is it a valid for server SOAP Envelope? does it have all what server requires by its contract (WSDL)?

How do I receive this code in php? And how do I consume it?

I'm working on a website project to consume a web service, how do I receive this in php and how do I consume it? Thank you for helping out. I need to connect to their API, send the XML file genrerated in my website and then receive the response. http://www.safaricom.co.ke/business/corporate/m-pesa-payments-services/m-pesa-api for the api
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:c2b="http://cps.huawei.com/cpsinterface/c2bpayment">
<soapenv:Header/>
<soapenv:Body>
<c2b:C2BPaymentConfirmationRequest>
<TransactionType>PayBill</TransactionType>
<TransID>1234560000007031</TransID>
<TransTime>20140227082020</TransTime>
<TransAmount>123.00</TransAmount>
<BusinessShortCode>12345</BusinessShortCode>
<BillRefNumber>TX1001</BillRefNumber>
<InvoiceNumber></InvoiceNumber>
<OrgAccountBalance>12345.00</OrgAccountBalance>
<ThirdPartyTransID></ThirdPartyTransID>
<MSISDN>254722703614</MSISDN>
<KYCInfo>
<KYCName>[Personal Details][First Name]</KYCName>
<KYCValue>Hoiyor</KYCValue>
</KYCInfo>
<KYCInfo>
<KYCName>[Personal Details][Middle Name]</KYCName>
<KYCValue>G</KYCValue>
</KYCInfo>
<KYCInfo>
<KYCName>[Personal Details][Last Name]</KYCName>
<KYCValue>Chen</KYCValue>
</KYCInfo>
</c2b:C2BPaymentConfirmationRequest>
</soapenv:Body>
</soapenv:Envelope>
My best advice is to use a WSDL to php generator such as PackageGenerator as you'll only deal with object to send the request then only deal with object when getting back the response. Using the generated SDK really eases consuming any SOAP Web Service. It uses the native SoapClient class (which is the first real starting point in this case if you wish to understand deeply the process).
Safaricom has released M-Pesa APIs as RESTful APIs accessible through their developer portal . You need not use the M-Pesa SOAP APIs.

Create WSDL message from SOAP Response

I have a WSDL that contains a different response then the actual responds with. I want to update the WSDL with the format of the API response but am having trouble. Is there a tool to generate a WSDL response from SOAP XML?
I should mention that they gave me the WSDL as a file, no public WSDL is visible.
The response contains this unknown anonymous xml element, s-gensym3. It should be userid.
If it's a .NET web service you can browse to [serviceurl]?WSDL to get the WSDL.
There's surely service endpoint you communicate with. You shall be able to invoke this endpoint in the browser and add to the end:
?wsdl
i.e. http://service:8123/operationName?wsdl
This will print you entire WSDL. Just make sure you have the same and you're done.

Sending the post method contents in REST invocation from WSO2 ESB

I have been trying to invoke a rest operation from my wso2 ESB and was successful in invoking the rest post method from WSO2 ESB. But, un luckily i was not able to access the data that i posted, neither through request parameters nor through request attributes.
PS: I don't want to frame a get kind of URLs for my post request.
is there a solution to this ?
You need to use the correct content type so it will preserve POST request data.This post will help you to understand the reason.
Edit.
1) Add the following entry to axis2.xml in message builders.
<messageBuilder contentType="application/x-www-form-urlencoded"
class="org.apache.synapse.commons.builders.XFormURLEncodedBuilder"/>
2) then access the required parameter in esb using
<property name="NameOfTheProperty" expression="//xformValues/NameOfTheProperty/text()"/>