function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VikVik 

ClientGen generated Code - Issue - Method Definition different

I generated my client using weblogic clientgen from Salesforce WSDL.

 

Salesforce method Mystub.readDeal(a,b,c,d,e,f); expects me to send 6 objects and when done I get error as shown:

 

I get - No operation available for request {http://soap.sforce.com/schemas/class/DealWebService}readDeal

 

But when I generate my stub using axis, Mystub.readDeal(a,b,c,d,e) expects me to send only 5 methods and it works well.

 

I am using same WSDL......I double checked

 

Is their some problem between clientgen (8.1 weblogic) and Salesforce?? If yes, any workaround?

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

There you go, the request that fails, is sent to URL        :  https://cs1-api.salesforce.com/services/Soap/c/18.0/00DS00000000gNs/0DFS00000008RUE which is not correct (see the wsdl for your apex service for the correct URL)

All Answers

SuperfellSuperfell

What are the 6 objects you're expected to send? some toolkits have you pass headers in the function call, rather than being properties on the stub.

VikVik

When generated from Clientgen it expects us to send

 

ReadDealResponse com.citi.cmb.modms.webservices.client.dealweb.DealWebServicePortType_Stub.readDeal(ReadDeal arg0, SessionHeader arg1, CallOptions arg2, DebuggingHeader arg3, AllowFieldTruncationHeader arg4, DebuggingInfoHolder arg5) throws RemoteException

 

----------------------------------------------------------------------------------------------------------------------------------------------------

When from Axis - (It works fine)...you can see that DebuggingInfoHolder is asked above but not below

 

ReadDealResponse com.sforce.soap.schemas._class.dealwebservice.DealWebServiceServiceStub.readDeal(ReadDeal readDeal99, SessionHeader sessionHeader100, CallOptions callOptions101, DebuggingHeader debuggingHeader102, AllowFieldTruncationHeader allowFieldTruncationHeader103) throws RemoteException

SuperfellSuperfell

I think the number of parameters is a red herring. the no operation for method comes from sending the request to the wrong URL.

VikVik

Hello Simon...Great Thanks but.......:smileysad:

No operation can't come when you send request to correct URL but with different parameters?

 

Because - I comared the URL...they are perfect.

 

It's the method definition...please have a look

 

ClientGen Generated (Weblogic) - dealStub.readDeal(rd,dealSessionHeader,co,dh,af, dinfh); - 6 Parameters (DebuggingInfoHolder object is expected by client. If not given sixth parameter - it won't compile)

 

Axis generated - dealwsstub.readDeal(rd, sh, co, dh, af); - 5 Parameters

VikVik

Also, When tried using clientgen 9.2 , we can see following warnings when converting wsdl 2 client.

 

[clientgen] [WARNING] The binding soap:header element for binding operation:
[clientgen] {http://soap.sforce.com/schemas/class/DealWebService}readDeal
[clientgen] is being IGNORED because its message:
[clientgen] {http://soap.sforce.com/schemas/class/DealWebService}Header
[clientgen] does not match the corresponding input/output portType message:
[clientgen] {http://soap.sforce.com/schemas/class/DealWebService}readDealRequest


SuperfellSuperfell

The things that matter are the namespace & localname of the first child element of the body, and the URL its sent to.

 

Can you post a HTTP capture of your complete request ?

VikVik

Hello Simon

 

Sending all of it. First connection is made to test.salesforce.com which goes very well and then it fails because of method. I am also pasting some code here:

 

**************************CODE START*********************************

LogInfo[] li = new LogInfo[1];
                li[0] = new LogInfo();
                li[0].setCategory(LogCategory.All);
                li[0].setLevel(LogCategoryLevel.Debug);

                DebuggingHeader dh = new DebuggingHeader();        
                dh.setCategories(li);
                dh.setDebugLevel(LogType.None);
                
               // ID id = new ID();
               // id.setID("006S0000003g6nXIAQ");
                
                DealWSObj dwo = new DealWSObj();
                dwo.setDealId("006S0000003g6nXIAQ");
                
                AllowFieldTruncationHeader af = new AllowFieldTruncationHeader();
                af.setAllowFieldTruncation(true);
                
                CallOptions co = new CallOptions();
                co.setClient("Citi");
                
                DebuggingInfoHolder dinfh = new DebuggingInfoHolder();

 

ReadDeal rd = new ReadDeal();
                rd.setVDeal(dwo);

 

ReadDealResponse readresponse = new ReadDealResponse();
                readresponse = dealStub.readDeal(rd,dealSessionHeader,co,dh,af, dinfh);

 

 

**********************CODE END********************************

 

************************LOGS START***********************************

 

<!-------------------- REQUEST FROM CLIENT ---------------->
URL        :  https://test.salesforce.com/services/Soap/c/18.0/0DFS00000008RUE
ContentType:  text/xml
Headers    :
POST /services/Soap/c/18.0/0DFS00000008RUE HTTP/1.0
Host: test.salesforce.com:80
Connection: Keep-Alive
Content-Length: 545
Content-Type: text/xml
SOAPAction: ""


Envelope   :
<env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header><n2:LoginScopeHeader xmlns:n2="urn:enterprise.soap.sforce.com" xsi:nil="true"/></env:Header><env:Body><n1:login xmlns:n1="urn:enterprise.soap.sforce.com"><n1:username>vikas.grover@citi.com.fullcopy</n1:username><n1:password>vikas123DyQLpfymg6s1VVPFGezkq2ypl</n1:password></n1:login></env:Body></env:Envelope>
<!-------------------- END REQUEST FROM CLIENT ------------>
<!-------------------- RESPONSE TO CLIENT --------------->
URL        : https://test.salesforce.com/services/Soap/c/18.0/0DFS00000008RUE
StatusCode : 200
Headers    :
  CONTENT-LENGTH = 1613
  DATE = Thu, 24 Jun 2010 154735 GMT
  CONTENT-TYPE = text/xml; charset=utf-8
  SERVER =
Envelope   :
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse><result><metadataServerUrl>https://cs1-api.salesforce.com/services/Soap/m/18.0/00DS00000000gNs</metadataServerUrl><passwordExpired>false</passwordExpired><sandbox>true</sandbox><serverUrl>https://cs1-api.salesforce.com/services/Soap/c/18.0/00DS00000000gNs/0DFS00000008RUE</serverUrl><sessionId>00DS00000000gNs!AR0AQP.F58UM5Qt2um0JYK9XL.RXlF32EF5MvBv1MqaMnN.reqdAlp0TXpsKEMWs.CUdcW..az_AgZZMBZCSINg.l59oKwYd</sessionId><userId>005S0000000FAcfIAG</userId><userInfo><accessibilityMode>false</accessibilityMode><currencySymbol xsi:nil="true"/><orgDefaultCurrencyIsoCode xsi:nil="true"/><orgDisallowHtmlAttachments>false</orgDisallowHtmlAttachments><orgHasPersonAccounts>false</orgHasPersonAccounts><organizationId>00DS00000000gNsMAI</organizationId><organizationMultiCurrency>true</organizationMultiCurrency><organizationName>Citi</organizationName><profileId>00e20000000rUO9AAM</profileId><roleId xsi:nil="true"/><userDefaultCurrencyIsoCode>GBP</userDefaultCurrencyIsoCode><userEmail>vikas.grover@citi.com</userEmail><userFullName>Vikas Grover</userFullName><userId>005S0000000FAcfIAG</userId><userLanguage>en_US</userLanguage><userLocale>en_GB</userLocale><userName>vikas.grover@citi.com.fullcopy</userName><userTimeZone>Europe/London</userTimeZone><userType>Standard</userType><userUiSkin>Theme3</userUiSkin></userInfo></result></loginResponse></soapenv:Body></soapenv:Envelope>
<!-------------------- END RESPONSE TO CLIENT ----------->
Welcome to Vikas Grover

 

rd = 006S0000003g6nXIAQ
sh = 00DS00000000gNs!AR0AQP.F58UM5Qt2um0JYK9XL.RXlF32EF5MvBv1MqaMnN.reqdAlp0TXpsKEMWs.CUdcW..az_AgZZMBZCSINg.l59oKwYd
sh = SessionHeader{ sessionId=<00DS00000000gNs!AR0AQP.F58UM5Qt2um0JYK9XL.RXlF32EF5MvBv1MqaMnN.reqdAlp0TXpsKEMWs.CUdcW..az_AgZZMBZCSINg.l59oKwYd> }
co = Citi
dh = [Lcom.sforce.soap.schemas.class0.DealWebService.LogInfo;@1884a40
af is here= true
dealwsstub is here = com.citi.cmb.modms.webservices.client.dealweb.DealWebServicePortType_Stub@c2ee15
Got new socketfactory javax.net.ssl.impl.SSLSocketFactoryImpl@19cd75a
Connecting to:cs1-api.salesforce.com port:443 socket:Socket[unconnected]
<!-------------------- REQUEST FROM CLIENT ---------------->
URL        :  https://cs1-api.salesforce.com/services/Soap/c/18.0/00DS00000000gNs/0DFS00000008RUE
ContentType:  text/xml
Headers    :
POST /services/Soap/c/18.0/00DS00000000gNs/0DFS00000008RUE HTTP/1.0
Host: cs1-api.salesforce.com:80
Connection: Keep-Alive
Content-Length: 1209
Content-Type: text/xml
SOAPAction: ""


Envelope   :
<env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header><n2:SessionHeader xmlns:n2="http://soap.sforce.com/schemas/class/DealWebService"><n2:sessionId>00DS00000000gNs!AR0AQP.F58UM5Qt2um0JYK9XL.RXlF32EF5MvBv1MqaMnN.reqdAlp0TXpsKEMWs.CUdcW..az_AgZZMBZCSINg.l59oKwYd</n2:sessionId></n2:SessionHeader><n3:CallOptions xmlns:n3="http://soap.sforce.com/schemas/class/DealWebService"><n3:client>Citi</n3:client></n3:CallOptions><n4:DebuggingHeader xmlns:n4="http://soap.sforce.com/schemas/class/DealWebService"><n4:categories><n4:category>All</n4:category><n4:level>Debug</n4:level></n4:categories><n4:debugLevel>None</n4:debugLevel></n4:DebuggingHeader><n5:AllowFieldTruncationHeader xmlns:n5="http://soap.sforce.com/schemas/class/DealWebService"><n5:allowFieldTruncation>true</n5:allowFieldTruncation></n5:AllowFieldTruncationHeader></env:Header><env:Body><n1:readDeal xmlns:n1="http://soap.sforce.com/schemas/class/DealWebService"><n1:vDeal><n1:dealId>006S0000003g6nXIAQ</n1:dealId></n1:vDeal></n1:readDeal></env:Body></env:Envelope>
<!-------------------- END REQUEST FROM CLIENT ------------>
<!-------------------- RESPONSE TO CLIENT --------------->
URL        : https://cs1-api.salesforce.com/services/Soap/c/18.0/00DS00000000gNs/0DFS00000008RUE
StatusCode : 500
Headers    :
  CONNECTION = Keep-Alive
  CONTENT-LENGTH = 353
  DATE = Thu, 24 Jun 2010 154736 GMT
  CONTENT-TYPE = text/xml; charset=utf-8
  SERVER =
Envelope   :
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>No operation available for request {http://soap.sforce.com/schemas/class/DealWebService}readDeal</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>
<!-------------------- END RESPONSE TO CLIENT ----------->
java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: No operation available for request {http://soap.sforce.com/schemas/class/DealWebService}readDeal
Detail:
null; nested exception is:
    javax.xml.rpc.soap.SOAPFaultException: No operation available for request {http://soap.sforce.com/schemas/class/DealWebService}readDeal
    at com.citi.cmb.modms.webservices.client.dealweb.DealWebServicePortType_Stub.readDeal(DealWebServicePortType_Stub.java:76)
    at com.sforce.soap.enterprise.client.SalesforceClient.main(SalesforceClient.java:127)
Caused by: javax.xml.rpc.soap.SOAPFaultException: No operation available for request {http://soap.sforce.com/schemas/class/DealWebService}readDeal
    at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:317)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:147)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:473)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:459)
    at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:306)
    at com.citi.cmb.modms.webservices.client.dealweb.DealWebServicePortType_Stub.readDeal(DealWebServicePortType_Stub.java:71)
    ... 1 more


 

SuperfellSuperfell

There you go, the request that fails, is sent to URL        :  https://cs1-api.salesforce.com/services/Soap/c/18.0/00DS00000000gNs/0DFS00000008RUE which is not correct (see the wsdl for your apex service for the correct URL)

This was selected as the best answer
VikVik

My colleague was overriding the url in the class somewhere and I was confused because I saw difference between method definition of axis and clientgen.

Thanks for support Simon.