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
S-ControlsS-Controls 

Apex to external Web Service communication

Hi
I'm new to Apex development.
I'm trying to communicate from Apex to external Web Service.

I'm able to access the Web Service from some other Java client without any issues.
But while accessing the same Web Service from the Apex code, I'm getting the following error.

Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'

And I verified the SOAP request and response messages , they look good.
Here I'm copying them

SOAP Request
-----------------------------------------------------------------------------------------------
POST http://localhost:8080/Axis/services/SecondServiceSOAP HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.3

Host: localhost:8080

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 356

<?xml version="1.0" encoding="UTF-8"?>
<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:concatRequest xmlns:ns1="http://ttdev.com/ss">
<s1>abc</s1>
<s2>124</s2>
</ns1:concatRequest>
</soapenv:Body>
</soapenv:Envelope>
--------------------------------------------------------------------------------------------------------


SOAP Response
--------------------------------------------------------------------------------------------------------

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Content-Type: text/xml;charset=utf-8

Date: Tue, 22 Jan 2008 22:38:14 GMT

Connection: close



<?xml version="1.0" encoding="utf-8"?>
<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>
<concatResponse xmlns="http://ttdev.com/ss">
<companyName xmlns="">abc124</companyName>
</concatResponse>
</soapenv:Body>
</soapenv:Envelope>
-----------------------------------------------------------------------------------------------------

I'm using Axis1.3 and Tomcat 5.5 on SalesForce 8.

The Apex version and the endpoint version are 11.1

Can you please help me in solving this issue at the earliest.

Thanks
Sarada


cheenathcheenath
It seems you are hitting localhost?

> http://localhost:8080/Axis/services/SecondServiceSOAP

Your server should be accessable from salesforce.com.




S-ControlsS-Controls
Hi
Thanks for giving the clue.
I verified with the url http://ipaddressof my Machine:8080/Axis/services/SecondServiceSOAP

then its throwing
IO Exception : Read Timed Out

I increased the Read Time out for that Force.com project to 420 seconds, but still facing the same issue.

If you have any idea please let me know.

Thanks
Sarada
cheenathcheenath
It seems your machine is not reachable from sfdc. If you can tell me what the mcheine name/ip
address is I can try to ping it from here.


S-ControlsS-Controls
Hi Cheenath
I put some debug statements in the Apex code and ran it.
I could see the following information

Case1: If I gave localhost
--------------------------------------

12:14:28 DEBUG - 20080125195057.320:Class.sar.ttdevComSs.SecondServiceSOAP.concat: line 14, column 13: Created Web Service callout to endpoint: http://localhost:8080/Axis/services/SecondServiceSOAP 20080125195057.320:Class.sar.ttdevComSs.SecondServiceSOAP.concat: line 14, column 13: Sending callout request 20080125195057.320:Class.sar.ttdevComSs.SecondServiceSOAP.concat: line 14, column 13:
 <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header /><env:Body><concatRequest xmlns="http://ttdev.com/ss"><s1>Fujitsu</s1><s2>Labs2222</s2></concatRequest></env:Body></env:Envelope>

 20080125195057.320:Class.sar.ttdevComSs.SecondServiceSOAP.concat: line 14, column 13: Reading callout response 20080125195057.320:Class.sar.ttdevComSs.SecondServiceSOAP.concat: line 14, column 13:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /Axis/services/SecondServiceSOAP was not found on this server.</p> </body></html>

 System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html' Class.sar.ttdevComSs.SecondServiceSOAP.concat: line 14, column 13 AnonymousBlock.sar: line 1, column 1 Class.sar.TestApex.getCompanyName: line 33, column 23

That means I'm able to send the request to SalesForce and getting the error Repsonse.
-------------------------------------------------------------------------------------------------------------


Case2: If I give my ip address instead of localhost

I'm not getting the response but instead of that getting the following message

0080125200414.415:AnonymousBlock.sar: line 1, column 1: returning String from method webService static String getCompanyName() in 10016 ms

If you get any idea please let me know,

Thanks
Sarada











cheenathcheenath
Case 1 will not work. You can not give localhost as your external server address.

What is the error that you are getting for case 2.

0080125200414.415:AnonymousBlock.sar: line 1, column 1: returning String from method webService static String getCompanyName() in 10016 ms

This does not looks like an error.



S-ControlsS-Controls
for Case2 I'm getting the follwing error on the browser.

IO Exception: Read Timed out


In the debug statements showing the following message

20080125200414.415:AnonymousBlock.sar: line 1, column 1: returning String from method webService static String getCompanyName() in 10016 ms


Its taking long time  10016ms, may be that is why I'm getting Read Timed Out error


Ron HessRon Hess
10 seconds is the timeout, which it looks like you are hitting.

10016ms > 10 seconds.
S-ControlsS-Controls
Hi
I have changed the Read Time to 420sec while creating the Force.com project in the Eclipse.
Will it not effect the Read Time??

And I have one more question...

My Web Service is running at my server like http://myIpaddress:8080/Axis/Services/MySErvice

Is SFDC able to communicate my Web Service and get the data ??

Or else I have to make available the Web Serivce on any public IP to be accessible by SFDC??

Thanks
Sarada
Ron HessRon Hess
the time out on : System.CalloutException: Web service callout
not adjustable, it is 10 seconds

also
your webservice must be publicly available as it is accessed from our servers.
brad4dbrad4d
I have an apex client to an external webservice.  The external webservice expects as intput a set of arrays.  I construct what I think is the correct objects on the SF side and invoke the webservice.  I recevie a response indicating that the arrays are empty.  I cannot seem to discover how to get SF to dump the actual XML markup of the request as you have in this example.  Could you share the debug statements that you used to cause Apex to dump the soap markup that it is putting on the wire?
    Brad
cheenathcheenath
You can call the method from "System Log" and set the log level to Callout.



S-ControlsS-Controls
Hi
I'm still running into issues after I made available my web service on a public ip.

I'm getting the folowing error

Unable to parse callout response. Apex type not found for element: companyName

Any clues??

Thanks
Sarada
cheenathcheenath
What is the schema type for companyName?


S-ControlsS-Controls
<wsdl:definitions
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:tns="http://ttdev.com/ss"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SecondService" targetNamespace="http://ttdev.com/ss">
<wsdl:types>
<xsd:schema targetNamespace="http://ttdev.com/ss">
    <xsd:element name="concatRequest" type="tns:ConcatRequest"></xsd:element>
    <xsd:element name="concatResponse" type="tns:ConcatResponse"></xsd:element>

    <xsd:complexType name="ConcatRequest">
        <xsd:sequence>
            <xsd:element name="s1" type="xsd:string"></xsd:element>
            <xsd:element name="s2" type="xsd:string"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ConcatResponse">
        <xsd:sequence>
            <xsd:element name="companyName" type="xsd:string"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>
</wsdl:types>


This is the part of the WSDL file from which I have generated the Apex code.
cheenathcheenath
Schema looks good. Call this method from "System Log" and set the log level to "Callout".
This will display the input and output SOAP request. Please post this XML. I will take a look.
BTW, which SOAP stack are you using on the server side?


S-ControlsS-Controls
12:24:15 DEBUG - 20080205202346.833:Class.sar.WebApex.displayCompanyName: line 6, column 13: Before stub creation1111 20080205202346.833:Class.sar.WebApex.displayCompanyName: line 9, column 13: Before method callnull 20080205202346.833:Class.sar.ttdevComSsImpl.SecondServiceSOAP.concat: line 10, column 13: s1 WebService s2 Test 20080205202346.833:Class.sar.ttdevComSsImpl.SecondServiceSOAP.concat: line 15, column 13: Created Web Service callout to endpoint: http://128.8.244.175:8080/Axis/services/SecondServiceSOAP 20080205202346.833:Class.sar.ttdevComSsImpl.SecondServiceSOAP.concat: line 15, column 13: Sending callout request 20080205202346.833:Class.sar.ttdevComSsImpl.SecondServiceSOAP.concat: line 15, column 13:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header />
<env:Body>
<concatRequest xmlns="http://ttdev.com/ss">
<s1>WebService</s1>
<s2>Test</s2>
</concatRequest>
</env:Body>
</env:Envelope>
20080205202346.833:Class.sar.ttdevComSsImpl.SecondServiceSOAP.concat: line 15, column 13: Reading callout response 20080205202346.833:Class.sar.ttdevComSsImpl.SecondServiceSOAP.concat: line 15, column 13:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<concatResponse xmlns="http://ttdev.com/ss"><companyName xmlns="">WebService Test</companyName>
</concatResponse>
</soapenv:Body>
</soapenv:Envelope>
20080205202346.833:AnonymousBlock.sar: line 1, column 1: returning String from method webService static String displayCompanyName() in 187 ms

I verified in the System log, the SOAP messages look good.
I didn't get your question about the SOAP stack...

Thanks


cheenathcheenath
I think the response is not correct. Your schema says that elementFormDefault="qualified" (the default) but the
xml response sets no namespace for companyName. It should be qualified.

So instead of:
<concatResponse xmlns="http://ttdev.com/ss"><companyName xmlns="">WebService Test</companyName>

it should be:
<concatResponse xmlns="http://ttdev.com/ss"><companyName>WebService Test</companyName>

What server are you running, .Net, AXIS?



S-ControlsS-Controls
Thanks for your suggestion, let me try with that.

I'm using Axis1.3

Thanks
Sarada
S-ControlsS-Controls
No luck...

And when I'm trying to call the WebSErvice using the Java client, I got the following SOAP request n REsponse messages

SOAP Request
----------------------

POST http://localhost:8080/Axis/services/SecondServiceSOAP HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.3
Host: localhost:8080
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 356
 
<?xml version="1.0" encoding="UTF-8"?>
   <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:concatRequest xmlns:ns1="http://ttdev.com/ss">
            <s1>abc</s1>
            <s2>124</s2>
         </ns1:concatRequest>
      </soapenv:Body>
   </soapenv:Envelope>
  
SOAP Response
-----------------------
 
 
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Date: Tue, 05 Feb 2008 23:29:38 GMT
Connection: close
 
<?xml version="1.0" encoding="utf-8"?>
   <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>
         <concatResponse xmlns="http://ttdev.com/ss">
            <companyName xmlns="">abc124</companyName>
         </concatResponse>
      </soapenv:Body>
   </soapenv:Envelope>


Here also it contains xmlns="" for companyName.
I added elementFormDefault="qualified" for schema.. but still facing the same problem..

Web service callout failed: Unable to parse callout response. Apex type not found for element =companyName


cheenathcheenath
Your server is returning response as if elementFormDefault="unqualified" but the
WSDL says it is elementFormDefault="qualified".

1. So either you change the wsdl to unqualified:

<xsd:schema targetNamespace="http://ttdev.com/ss" elementFormDefault="unqualified">

2. Change the server to be qualified. So that it match up with the wsdl.
There should be some AXIS setting that you can tweak to do this.

HTHs,



S-ControlsS-Controls
I have added the elementFormDefalt ="qualified" , now its working fine.
 
Thanks for your valuable suggestion.
 
Regards
Sarada
Raghu_devRaghu_dev
Hi,

I am having similar problem when accessing strikeiron webservice. Since this thread was very helpful and is very close to my problem, I though I could post my issue here. Please help me and btw, am NEW to SFDC.

As said above, I am accessing strikeiron webservice and trying to show the output in a scontrol but I am getting an error saying

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://www.strikeiron.com=ServiceStatus

Code:
// Here is the scontrol code //

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/12.0/connection.js"></script>
    <script src="/soap/ajax/12.0/apex.js"></script>
</head>

<body>
<div class="pagelabel"> Call webservice</div>
  <script language="javascript" type="text/javascript"> 
  function callStrikeIron()
  {
   //alert("Call Strike");
   var elem = document.getElementById("docBody");
   sforce.apex.debug=true;
   var theBody = '<table><tr><td>ZipInfo</td><td>';
   var result = sforce.apex.execute("StrikeIronWrapper", "wrapper", {varZipCode:"19406"});
   theBody += result + '</td></tr></table>';
   elem.innerHTML = theBody;
  }
  
  callStrikeIron();
  </script>
<div id="docBody"></div>
</body>
</html>

// Here is the actual class

//Generated by wsdl2apex

global class zipInfoLookup{
    public class ZipInfoListing {
        public String CityName;
        public String PreferredName;
        public String StateAbbreviation;
        public String Classification;
        public String County;
        private String[] CityName_type_info = new String[]{'CityName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] PreferredName_type_info = new String[]{'PreferredName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] StateAbbreviation_type_info = new String[]{'StateAbbreviation','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Classification_type_info = new String[]{'Classification','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] County_type_info = new String[]{'County','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'CityName','PreferredName','StateAbbreviation','Classification','County'};
    }
    public class ServiceOutput {
        public zipInfoLookup.SIWsStatus ServiceStatus;
        private String[] ServiceStatus_type_info = new String[]{'ServiceStatus','http://www.strikeiron.com','SIWsStatus','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceStatus'};
    }
    public class ZipInfoResult {
        public String Code;
        public String Latitude;
        public String Longitude;
        public String TimeZone;
        public String StandardGMTOffset;
        public String DaylightGMTOffset;
        public zipInfoLookup.ArrayOfZipInfoListing Listings;
        private String[] Code_type_info = new String[]{'Code','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Latitude_type_info = new String[]{'Latitude','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Longitude_type_info = new String[]{'Longitude','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] TimeZone_type_info = new String[]{'TimeZone','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] StandardGMTOffset_type_info = new String[]{'StandardGMTOffset','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] DaylightGMTOffset_type_info = new String[]{'DaylightGMTOffset','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Listings_type_info = new String[]{'Listings','http://www.strikeiron.com','ArrayOfZipInfoListing','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Code','Latitude','Longitude','TimeZone','StandardGMTOffset','DaylightGMTOffset','Listings'};
    }
    public class ServiceInfoRecord {
        public String InfoKey;
        public String InfoValue;
        private String[] InfoKey_type_info = new String[]{'InfoKey','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] InfoValue_type_info = new String[]{'InfoValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'InfoKey','InfoValue'};
    }
    public class zipinfoSoap {
        public String endpoint_x = 'http://ws.strikeiron.com/StrikeIron/ZipInfo3/zipinfo';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public wsStrikeironCom.SubscriptionInfo SubscriptionInfo;
        public wsStrikeironCom.LicenseInfo LicenseInfo;
        private String SubscriptionInfo_hns = 'SubscriptionInfo=http://ws.strikeiron.com';
        private String LicenseInfo_hns = 'LicenseInfo=http://ws.strikeiron.com';
        private String[] ns_map_type_info = new String[]{'http://ws.strikeiron.com', 'wsStrikeironCom', 'http://www.strikeiron.com', 'zipInfoLookup'};
        public void GetRemainingHits() {
            wsStrikeironCom.GetRemainingHits_element request_x = new wsStrikeironCom.GetRemainingHits_element();
            wsStrikeironCom.GetRemainingHitsResponse_element response_x;
            Map<String, wsStrikeironCom.GetRemainingHitsResponse_element> response_map_x = new Map<String, wsStrikeironCom.GetRemainingHitsResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://ws.strikeiron.com/StrikeIron/ZipInfo3/zipinfo/GetRemainingHits',
              'http://ws.strikeiron.com',
              'GetRemainingHits',
              'http://ws.strikeiron.com',
              'GetRemainingHitsResponse',
              'wsStrikeironCom.GetRemainingHitsResponse_element'}
            );
            response_x = response_map_x.get('response_x');
        }
        public zipInfoLookup.StatusCodeOutput GetAllStatuses() {
            zipInfoLookup.GetAllStatuses_element request_x = new zipInfoLookup.GetAllStatuses_element();
            zipInfoLookup.GetAllStatusesResponse_element response_x;
            Map<String, zipInfoLookup.GetAllStatusesResponse_element> response_map_x = new Map<String, zipInfoLookup.GetAllStatusesResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetAllStatuses',
              'http://www.strikeiron.com',
              'GetAllStatuses',
              'http://www.strikeiron.com',
              'GetAllStatusesResponse',
              'zipInfoLookup.GetAllStatusesResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetAllStatusesResult;
        }
        public zipInfoLookup.ServiceInfoOutput GetServiceInfo() {
            zipInfoLookup.GetServiceInfo_element request_x = new zipInfoLookup.GetServiceInfo_element();
            zipInfoLookup.GetServiceInfoResponse_element response_x;
            Map<String, zipInfoLookup.GetServiceInfoResponse_element> response_map_x = new Map<String, zipInfoLookup.GetServiceInfoResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetServiceInfo',
              'http://www.strikeiron.com',
              'GetServiceInfo',
              'http://www.strikeiron.com',
              'GetServiceInfoResponse',
              'zipInfoLookup.GetServiceInfoResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetServiceInfoResult;
        }
        public zipInfoLookup.ZipInfoOutput GetCityState(String ZipCode) {
         // zipInfoLookup.ZipInfoOutput
            zipInfoLookup.GetCityState_element request_x = new zipInfoLookup.GetCityState_element();
            zipInfoLookup.GetCityStateResponse_element response_x;
            request_x.ZipCode = ZipCode;
            Map<String, zipInfoLookup.GetCityStateResponse_element> response_map_x = new Map<String, zipInfoLookup.GetCityStateResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetCityState',
              'http://www.strikeiron.com',
              'GetCityState',
              'http://www.strikeiron.com',
              'GetCityStateResponse',
              'zipInfoLookup.GetCityStateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            system.debug('response ' + response_x);
            return response_x.GetCityStateResult;
        }
    }
    public class GetServiceInfo_element {
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{};
    }
    public class SIWsStatus {
        public Integer StatusNbr;
        public String StatusDescription;
        private String[] StatusNbr_type_info = new String[]{'StatusNbr','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] StatusDescription_type_info = new String[]{'StatusDescription','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'StatusNbr','StatusDescription'};
    }
    public class ArrayOfZipInfoListing {
        public zipInfoLookup.ZipInfoListing[] ZipInfoListing;
        private String[] ZipInfoListing_type_info = new String[]{'ZipInfoListing','http://www.strikeiron.com','ZipInfoListing','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ZipInfoListing'};
    }
    public class StatusCodeOutput {
        public zipInfoLookup.StatusCodeResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','StatusCodeResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
    public class ArrayOfSIWsStatus {
        public zipInfoLookup.SIWsStatus[] SIWsStatus;
        private String[] SIWsStatus_type_info = new String[]{'SIWsStatus','http://www.strikeiron.com','SIWsStatus','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'SIWsStatus'};
    }
    global class ZipInfoOutput {
        public zipInfoLookup.ZipInfoResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','ZipInfoResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
    public class SIWsResult {
        public Integer Count;
        private String[] Count_type_info = new String[]{'Count','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Count'};
    }
    public class GetCityState_element {
        public String ZipCode;
        private String[] ZipCode_type_info = new String[]{'ZipCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ZipCode'};
    }
    public class StatusCodeResult {
        public zipInfoLookup.ArrayOfSIWsStatus Statuses;
        private String[] Statuses_type_info = new String[]{'Statuses','http://www.strikeiron.com','ArrayOfSIWsStatus','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Statuses'};
    }
    public class SIServiceInfoResult {
        public zipInfoLookup.ArrayOfServiceInfoRecord ServiceInfo;
        private String[] ServiceInfo_type_info = new String[]{'ServiceInfo','http://www.strikeiron.com','ArrayOfServiceInfoRecord','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceInfo'};
    }
    public class ArrayOfServiceInfoRecord {
        public zipInfoLookup.ServiceInfoRecord[] ServiceInfoRecord;
        private String[] ServiceInfoRecord_type_info = new String[]{'ServiceInfoRecord','http://www.strikeiron.com','ServiceInfoRecord','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceInfoRecord'};
    }
    public class GetAllStatuses_element {
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{};
    }
    public class GetServiceInfoResponse_element {
        public zipInfoLookup.ServiceInfoOutput GetServiceInfoResult;
        private String[] GetServiceInfoResult_type_info = new String[]{'GetServiceInfoResult','http://www.strikeiron.com','ServiceInfoOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetServiceInfoResult'};
    }
    public class GetCityStateResponse_element {
        public zipInfoLookup.ZipInfoOutput GetCityStateResult;
        private String[] GetCityStateResult_type_info = new String[]{'GetCityStateResult','http://www.strikeiron.com','ZipInfoOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetCityStateResult'};
    }
    public class GetAllStatusesResponse_element {
        public zipInfoLookup.StatusCodeOutput GetAllStatusesResult;
        private String[] GetAllStatusesResult_type_info = new String[]{'GetAllStatusesResult','http://www.strikeiron.com','StatusCodeOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetAllStatusesResult'};
    }
    public class ServiceInfoOutput {
        public zipInfoLookup.SIServiceInfoResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','SIServiceInfoResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
}
// Here is the wrapper
global class StrikeIronWrapper {
 webservice static zipInfoLookup.ZipInfoOutput wrapper(string varZipCode){
  //zipInfoLookup zipInfoLookupCls = new zipInfoLookup();
  zipInfoLookup.zipinfoSoap zip = new zipInfoLookup.zipinfoSoap();
  zip.LicenseInfo = new wsStrikeironCom.LicenseInfo();
  zip.LicenseInfo.RegisteredUser = new wsStrikeironCom.RegisteredUser();
  zip.LicenseInfo.RegisteredUser.UserID = 'test@test.com';
  zip.LicenseInfo.RegisteredUser.Password = 'test';
  //zipInfoLookup.ZipInfoOutput zipinfo = zip.GetCityState('06010');
  zipInfoLookup.ZipInfoOutput zipinfo =  zip.GetCityState(varZipCode);
  return zipinfo;
 }
}


 

jeeteshjeetesh

It is not the problem of time out.

It seems that either your server is nott started yet or there is no defination to handling the requested Company name attribute.