2014-07-09 1 views
0

클라이언트에서 제공하는 내 로컬 컴퓨터에 WSDL이 저장되어 있습니다. 민감한 데이터는 공용으로 게시 할 수 있습니다. 수정 된 버전을 게시하고 있습니다.서버가 요청을 처리 할 수 ​​없습니다. ---> 객체 참조가 Worklight 6.1.0을 사용하는 객체의 인스턴스로 설정되지 않습니까?

<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.Client.in/StoreLocator" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.Client.in/StoreLocator"> 
<wsdl:types> 
<s:schema elementFormDefault="qualified" targetNamespace="http://www.Client.in/StoreLocator"> 
<s:element name="GetClientStore"> 
<s:complexType> 
<s:sequence> 
<s:element minOccurs="0" maxOccurs="1" name="fromLongitude" type="s:string"/> 
<s:element minOccurs="0" maxOccurs="1" name="fromLatitude" type="s:string"/> 
</s:sequence> 
</s:complexType> 
</s:element> 
<s:element name="GetClientStoreResponse"> 
<s:complexType> 
<s:sequence> 
<s:element minOccurs="0" maxOccurs="1" name="GetClientStoreResult" type="s:string"/> 
</s:sequence> 
</s:complexType> 
</s:element> 
<s:element name="AuthsoapHead" type="tns:AuthsoapHead"/> 
<s:complexType name="AuthsoapHead"> 
<s:sequence> 
<s:element minOccurs="0" maxOccurs="1" name="FirstKey" type="s:string"/> 
<s:element minOccurs="0" maxOccurs="1" name="SecondKey" type="s:string"/> 
</s:sequence> 
<s:anyAttribute/> 
</s:complexType> 
</s:schema> 
</wsdl:types> 
<wsdl:message name="GetClientStoreSoapIn"> 
<wsdl:part name="parameters" element="tns:GetClientStore"/> 
</wsdl:message> 
<wsdl:message name="GetClientStoreSoapOut"> 
<wsdl:part name="parameters" element="tns:GetClientStoreResponse"/> 
</wsdl:message> 
<wsdl:message name="GetClientStoreAuthsoapHead"> 
<wsdl:part name="AuthsoapHead" element="tns:AuthsoapHead"/> 
</wsdl:message> 
<wsdl:portType name="NearestStoreSoap"> 
<wsdl:operation name="GetClientStore"> 
<wsdl:input message="tns:GetClientStoreSoapIn"/> 
<wsdl:output message="tns:GetClientStoreSoapOut"/> 
</wsdl:operation> 
</wsdl:portType> 
<wsdl:binding name="NearestStoreSoap" type="tns:NearestStoreSoap"> 
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> 
<wsdl:operation name="GetClientStore"> 
<soap:operation soapAction="http://www.Client.in/StoreLocator/GetClientStore" style="document"/> 
<wsdl:input> 
<soap:body use="literal"/> 
<soap:header message="tns:GetClientStoreAuthsoapHead" part="AuthsoapHead" use="literal"/> 
</wsdl:input> 
<wsdl:output> 
<soap:body use="literal"/> 
</wsdl:output> 
</wsdl:operation> 
</wsdl:binding> 
<wsdl:binding name="NearestStoreSoap12" type="tns:NearestStoreSoap"> 
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/> 
<wsdl:operation name="GetClientStore"> 
<soap12:operation soapAction="http://www.Client.in/StoreLocator/GetClientStore" style="document"/> 
<wsdl:input> 
<soap12:body use="literal"/> 
<soap12:header message="tns:GetClientStoreAuthsoapHead" part="AuthsoapHead" use="literal"/> 
</wsdl:input> 
<wsdl:output> 
<soap12:body use="literal"/> 
</wsdl:output> 
</wsdl:operation> 
</wsdl:binding> 
<wsdl:service name="NearestStore"> 
<wsdl:port name="NearestStoreSoap" binding="tns:NearestStoreSoap"> 
<soap:address location="https://www.Client.in/StoreLocator/neareststore.asmx"/> 
</wsdl:port> 
<wsdl:port name="NearestStoreSoap12" binding="tns:NearestStoreSoap12"> 
<soap12:address location="https://www.Client.in/StoreLocator/neareststore.asmx"/> 
</wsdl:port> 
</wsdl:service> 
</wsdl:definitions> 

이 SOAP에서 결과를 얻으려면 Worklight 백 엔드 서비스를 사용하고 있습니다. 아래와 같이 위도 (경도)와 경도 (위도)에 따라 가장 가까운 매장을 가져 오도록의 매장 검색기 서비스 URL을 찾아보고 고객 저장소 로케이터 서비스 URL (요청 헤더의 값 전달)에 대한 테스트 키를 봅니다. 예 : FirstKey : FTG8F535DFGDFGER8GFDGG4FG8DGS, SecondKey : 비밀 번호.

--------------------------------- SoapAdapter1-impl.js -------- ------------------------------

function NearestStore_GetClientStore(params, headers){ 
    var soapEnvNS; 

    soapEnvNS = 'http://www.w3.org/2003/05/soap-envelope'; 
    var request = buildBody(params, 'xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://www.Client.in/StoreLocator" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" ', soapEnvNS); 
    return invokeWebService(request, headers); 
} 
function invokeWebService(body, headers){ 
    var input = { 
     method : 'post', 
     returnedContentType : 'xml', 
     path : '/StoreLocator/neareststore.asmx', 
     body: { 
      content : body.toString(), 
      contentType : 'text/xml; charset=utf-8' 
     } 
    }; 

    //Adding custom HTTP headers if they were provided as parameter to the procedure call 
    headers && (input['headers'] = headers); 

    return WL.Server.invokeHttp(input); 
} 

이제 직접 아래 절차를 사용하여 eclipse에서 프로 시저를 호출합니다.

{ 
      "GetClientStore": { 
        "fromLatitude": "18.9750", 
        "fromLongitude": "72.8258" 
       } 
      },{"soapAction": "http://www.Client.in/StoreLocator/GetClientStore","FirstKey":"FTG8F535DFGDFGER8GFDGG4FG8DGS","SecondKey":"password"} 

그리고 지금은 다음과 같이 오류가 점점 오전 :

{ 
    "Envelope": { 
     "Body": { 
     "Fault": { 
      "Code": { 
       "Value": "soap:Receiver" 
      }, 
      "Detail": "", 
      "Reason": { 
       "Text": { 
        "CDATA": "Server was unable to process request. ---> Object reference not set to an instance of an object.", 
        "lang": "en" 
       } 
      } 
     } 
     }, 
     "soap": "http:\/\/www.w3.org\/2003\/05\/soap-envelope", 
     "xsd": "http:\/\/www.w3.org\/2001\/XMLSchema", 
     "xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance" 
    }, 
    "errors": [ 
    ], 
    "info": [ 
    ], 
    "isSuccessful": true, 
    "responseHeaders": { 
     "Cache-Control": "private", 
     "Connection": "Keep-Alive", 
     "Content-Length": "508", 
     "Content-Type": "application\/soap+xml; charset=utf-8", 
     "Date": "Wed, 09 Jul 2014 11:57:13 GMT", 
     "X-Frame-Options": "SAMEORIGIN", 
     "X-MS-InvokeApp": "1; RequireReadOnly" 
    }, 
    "responseTime": 158, 
    "statusCode": 500, 
    "statusReason": "Internal Server Error", 
    "totalTime": 159, 
    "warnings": [ 
    ] 
} 

답변

0

을 마지막으로, 나는 내 자신의 질문에 대답 얻었다. 나는 요청에 대한 빨간색 오류 마크를 표시하지만, 그것을 무시하고 배포하고 호출합니다

function getLocation(latVar, longVar) { 

    var request = 
     <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:stor="http://www.client.in/StoreLocator"> 
      <soap:Header> 
       <stor:AuthsoapHead> 
        <stor:FirstKey>FTG8F535DFGDFGER8GFDGG4FG8DGS</stor:FirstKey> 
        <stor:SecondKey>password</stor:SecondKey> 
       </stor:AuthsoapHead> 
      </soap:Header> 
      <soap:Body> 
       <stor:GetclientStore> 
        <stor:fromLongitude>{longVar}</stor:fromLongitude> 
        <stor:fromLatitude>{latVar}</stor:fromLatitude> 
       </stor:GetclientStore> 
      </soap:Body> 
     </soap:Envelope>; 

    var input = { 
     method : 'post', 
     returnedContentType : 'xml', 
     path : '/StoreLocator/neareststore.asmx', 
     body: { 
      content: request.toString(), 
      contentType: 'text/xml; charset=utf-8' 
     }, 
    }; 
    var result = WL.Server.invokeHttp(input); 
    var filteredData = result.Envelope.Body.GetclientStoreResponse; 
    return filteredData; 
} 

자바 스크립트 아래와 같이 간단한 HTTP 어댑터를 개발했고, 나는 데이터가 아래와 같이 오는 것을 볼 수 있습니다

{ 
     "GetclientStoreResult": 
     "<Response> 
       <StatusCode>200<\/StatusCode> 
       <StoresCount>3<\/StoresCount> 
       <Stores> 

     <StoreDetails> 
      <StoreName>client Store<\/StoreName> 
      <AddressLine1>Fatehabad Road<\/AddressLine1> 
      <AddressLine2>Khasra No.-76, Mauja Rajpur, Near Amar Hotel, Fatehabad Road, Agra<\/AddressLine2> 
      <City>Agra<\/City> 
      <State>Uttar Pradesh<\/State> 
      <countryCode>IN<\/countryCode> 
      <Postalcode>282001<\/Postalcode> 
      <MainPhone>09x 1x 0x71x0<\/MainPhone> 
      <MobilePhone>09x 1x9 x97x9x<\/MobilePhone> 
      <MobilePhone2><\/MobilePhone2> 
      <HomePage>http:\/\/www.client.in<\/HomePage> 
      <EMail>[email protected]<\/EMail> 
      <Timings>1:10:30:19:30,2:10:30:19:30,3:10:30:19:30,4:10:30:19:30,5:10:30:19:30,6:10:30:19:30,7:10:30:19:30<\/Timings> 
      <PaymentType><\/PaymentType> 
      <Category>Mobile Service Provider Company<\/Category> 
      <Description>Service & Sales Store for client<\/Description> 
      <Latitude>27.164696<\/Latitude> 
      <Longitude>78.038031<\/Longitude> 
      <Distance>1.21778962564819<\/Distance> 
     <\/StoreDetails> 

     <StoreDetails> 
      <StoreName>client Store<\/StoreName> 
      <AddressLine1>VS Pratap Pura<\/AddressLine1> 
      <AddressLine2>client Store G1 & G2 Ground floor Hotel Usha Kiran Complex Pratap Pura MG Road Agra<\/AddressLine2> 
      <City>Agra<\/City> 
      <State>Uttar Pradesh<\/State> 
      <countryCode>IN<\/countryCode> 
      <Postalcode>282001<\/Postalcode> 
      <MainPhone>09x 19 x971x0<\/MainPhone> 
      <MobilePhone>0x7 19 x7190<\/MobilePhone> 
      <MobilePhone2><\/MobilePhone2> 
      <HomePage>http:\/\/www.client.in<\/HomePage> 
      <EMail>[email protected]<\/EMail> 
      <Timings>1:10:30:19:30,2:10:30:19:30,3:10:30:19:30,4:10:30:19:30,5:10:30:19:30,6:10:30:19:30,7:10:30:19:30<\/Timings> 
      <PaymentType><\/PaymentType> 
      <Category>Mobile Service Provider Company<\/Category> 
      <Description>Service & Sales Store for client<\/Description> 
      <Latitude>27.15356<\/Latitude> 
      <Longitude>78.007565<\/Longitude> 
      <Distance>4.1715187443831<\/Distance> 
     <\/StoreDetails> 

     <StoreDetails> 
      <StoreName>client Store<\/StoreName> 
      <AddressLine1>Sanjay Place<\/AddressLine1> 
      <AddressLine2>Shop No. G-1, Block No. 38\/4B, Sanjay Place, Agra<\/AddressLine2> 
      <City>Agra<\/City> 
      <State>Uttar Pradesh<\/State> 
      <countryCode>IN<\/countryCode> 
      <Postalcode>282002<\/Postalcode> 
      <MainPhone>0x7 1x 097x90<\/MainPhone> 
      <MobilePhone>0x7 19 0xx190<\/MobilePhone> 
      <MobilePhone2><\/MobilePhone2> 
      <HomePage>http:\/\/www.client.in<\/HomePage> 
      <EMail>[email protected]<\/EMail> 
      <Timings>1:10:30:19:30,2:10:30:19:30,3:10:30:19:30,4:10:30:19:30,5:10:30:19:30,6:10:30:19:30,7:10:30:19:30<\/Timings> 
      <PaymentType><\/PaymentType> 
      <Category>Mobile Service Provider Company<\/Category> 
      <Description>Service & Sales Store for client<\/Description> 
      <Latitude>27.198541<\/Latitude> 
      <Longitude>78.006023<\/Longitude> 
      <Distance>4.4289447148507<\/Distance> 
     <\/StoreDetails> 

     <\/Stores> 
<\/Response>", 


"isSuccessful": true, 
    "xmlns": "http:\/\/www.client.in\/StoreLocator" 
} 
관련 문제