我遇到了DataPower的问题。我正在尝试设置ws代理,但它不断抛出http 500.我将在下面提供wsdl,java代码。
我已将Remote Endpoint Host设置为我的ip(不是localhost):8080 - 我在Eclipse + Tomcat上托管这个ws,在VM上托管本地端点主机 - 使用未使用端口的DataPower Gateway Trial实例(我使用2911) )。我上传了wsdl文件并设置了它。
我正在尝试使用SOAP UI测试它,通过发送带有getUserName方法调用的POST请求到http://VMip/WebServiceProject/services/UsersCatalog,但我得到错误500.我想我尝试了所有但仍然无法使其工作。请帮忙!
UsersCatalog.wsdl
<wsdl:message name="setUserDataResponse">
<wsdl:part element="impl:setUserDataResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserDataRequest">
<wsdl:part element="impl:getUserData" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="setUserDataRequest">
<wsdl:part element="impl:setUserData" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserNameResponse">
<wsdl:part element="impl:getUserNameResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserDataResponse">
<wsdl:part element="impl:getUserDataResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserNameRequest">
<wsdl:part element="impl:getUserName" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="UsersCatalog">
<wsdl:operation name="getUserData">
<wsdl:input message="impl:getUserDataRequest" name="getUserDataRequest">
</wsdl:input>
<wsdl:output message="impl:getUserDataResponse" name="getUserDataResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="setUserData">
<wsdl:input message="impl:setUserDataRequest" name="setUserDataRequest">
</wsdl:input>
<wsdl:output message="impl:setUserDataResponse" name="setUserDataResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getUserName">
<wsdl:input message="impl:getUserNameRequest" name="getUserNameRequest">
</wsdl:input>
<wsdl:output message="impl:getUserNameResponse" name="getUserNameResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="UsersCatalogSoapBinding" type="impl:UsersCatalog">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getUserData">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getUserDataRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getUserDataResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="setUserData">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="setUserDataRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="setUserDataResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getUserName">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getUserNameRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getUserNameResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UsersCatalogService">
<wsdl:port binding="impl:UsersCatalogSoapBinding" name="UsersCatalog">
<wsdlsoap:address location="http://10.57.129.63:8080/WebServiceProject/services/UsersCatalog"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
UsersCatalog(userImpl只是包含2个字段的类 - userName和userAddress + getters and setter)
package wtp;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public class UsersCatalog implements User{
public static final User userImpl = new UserImpl();
@WebMethod
public String getUserName() {
return userImpl.getUserName();
}
@WebMethod
public String getUserData() {
return userImpl.getUserData();
}
@WebMethod
public void setUserData(String userName, String userAddress) {
userImpl.setUserData(userName, userAddress);
}
}
按照Anders的要求登录:
11:54:45 network debug 16945 response 10.57.129.63 0x80e0039e xmlfirewall (web-mgmt): url-open: response code 200
11:54:45 multistep debug 3044 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:45 multistep debug 3044 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:41 memory-report debug 33491 10.57.129.63 0x80e00690 wsgw (User.wsp): Response Finished: memory used 0
11:54:41 ws-proxy information 33491 error 10.57.129.63 0x80e000b6 wsgw (User.wsp): No match from processing policy 'User.wsp' for code '0x01130006'
11:54:41 ws-proxy warning 33491 10.57.129.63 0x80c0007b wsm-stylepolicy (User.wsp): No error rule is matched.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x810000d6 wsgw (User.wsp): Match: Received value [http://www.datapower.com/fragment-id#dp.all()] matches WSDL component type 'fragmentid' 'getUserData'.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x810000d6 wsgw (User.wsp): Match: Received value [http://www.datapower.com/fragment-id#dp.all()] matches WSDL component type 'fragmentid' 'getUserData'.
11:54:41 ws-proxy error 33491 error 10.57.129.63 0x01130006 wsgw (User.wsp): Failed to establish a backside connection
11:54:41 ws-proxy error 33491 10.57.129.63 0x80e00126 wsgw (User.wsp): Valid backside connection could not be established: Failed to establish a backside connection, url: http://10.57.129.63:2911/WebServiceProject/services/UsersCatalog
11:54:41 ws-proxy error 33491 10.57.129.63 0x80e00627 wsgw (User.wsp): Error occurred (port error) when connecting to URL 'http://10.57.129.63:2911/WebServiceProject/services/UsersCatalog'
11:54:41 network error 33491 0x80e00049 xmlmgr (default): Host connection failed to establish: 10.57.129.63 : tcp port 2911
11:54:41 network error 33491 0x00b30009 xmlmgr (default): Host connection could not be established
11:54:41 network debug 3471 0x80e006bd A hangup error occurred on socket (119). Error details (111: Connection refused). Local(10.57.129.109:25227) - Remote(n/a)
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00536 wsgw (User.wsp): HTTP Header-Retention:Compression Policy: Off, URL: /WebServiceProject/services/UsersCatalog
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00536 wsgw (User.wsp): HTTP Header-Retention:Header-Retention Policy:MQMD = OFF. MQMD Header = (NULL), URL: http://10.57.129.63:2911/WebServiceProject/services/UsersCatalog
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00536 wsgw (User.wsp): HTTP Header-Retention:Header-Retention Policy: Range = OFF. Range Header = (NULL), URL: http://10.57.129.63:2911/WebServiceProject/services/UsersCatalog
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00536 wsgw (User.wsp): HTTP Header-Retention:Header-Retention Policy: Accept-Encoding = OFF. Accept-Encoding Header = gzip,deflate, URL: http://10.57.129.63:2911/WebServiceProject/services/UsersCatalog
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00536 wsgw (User.wsp): HTTP Header-Retention:Header-Retention Policy: TE = OFF. TE Header = (NULL), URL: http://10.57.129.63:2911/WebServiceProject/services/UsersCatalog
11:54:41 network debug 33491 10.57.129.63 0x80e003ca xmlmgr (default): Attempting TCP connect to 10.57.129.63
11:54:41 multistep information 33491 request 10.57.129.63 0x80c00002 wsgw (User.wsp): rule (User.wsp_default_request-rule): #2 results: Generated from INPUT. Results stored in OUTPUT. completed OK.
11:54:41 memory-report debug 33491 request 10.57.129.63 0x80e0068d wsgw (User.wsp): Processing [Rule (User.wsp_default_request-rule), Action ('User.wsp_default_request-rule_defaultaction_result', results()), Input(INPUT), Output(OUTPUT)] finished: memory used 342160
11:54:41 multistep information 33491 request 10.57.129.63 0x80c00002 wsgw (User.wsp): rule (User.wsp_default_request-rule): #1 slm: 'INPUT User.wsp' completed OK.
11:54:41 memory-report debug 33491 request 10.57.129.63 0x80e0068d wsgw (User.wsp): Processing [Rule (User.wsp_default_request-rule), Action ('User.wsp_default_request-rule_defaultaction_slm', slm(User.wsp)), Input(INPUT), Output(NULL)] finished: memory used 0
11:54:41 xmlfilter information 33491 request 10.57.129.63 0x80c00036 wsgw (User.wsp): Accept set.
11:54:41 xslt debug 33491 10.57.129.63 0x80a002ac xmlmgr (default): xslt Compilation Request: Found in cache store:///dp/slmpolicy.xsl.
11:54:41 xslt debug 33491 10.57.129.63 0x80a002aa xmlmgr (default): xslt Compilation Request: Checking cache for URL 'store:///dp/slmpolicy.xsl'.
11:54:41 multistep debug 33491 request 10.57.129.63 0x80c0004e wsgw (User.wsp): Stylesheet URL to compile is 'store:///dp/slmpolicy.xsl'
11:54:41 ws-proxy information 33491 10.57.129.63 0x80a002a4 xmlmgr (default): wsdl Compilation Request: Compilation complete of URL 'local:///UsersCatalog.wsdl'. Memory used 1349568 bytes.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80a002a3 xmlmgr (default): wsdl Compilation Request: Beginning compilation of URL 'local:///UsersCatalog.wsdl'.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80a002af xmlmgr (default): wsdl Compilation Request: Not in cache. Compiling 'local:///UsersCatalog.wsdl'.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80a002aa xmlmgr (default): wsdl Compilation Request: Checking cache for URL 'local:///UsersCatalog.wsdl'.
11:54:41 xmlparse debug 33491 request 10.57.129.63 0x80e003ab wsgw (User.wsp): Finished parsing: http://10.57.129.110:2912/WebServiceProject/services/UsersCatalog
11:54:41 xmlparse debug 33491 request 10.57.129.63 0x80e003a6 wsgw (User.wsp): Parsing document: 'http://10.57.129.110:2912/WebServiceProject/services/UsersCatalog'
11:54:41 multistep warning 33491 request 10.57.129.63 0x00340027 wsgw (User.wsp): Multistep Probe enabled
11:54:41 memory-report debug 33491 10.57.129.63 0x80e0068c wsgw (User.wsp): Request Started: memory used 0
11:54:41 ws-proxy information 33491 request 10.57.129.63 0x80e000b4 wsm-stylepolicy (User.wsp): rule (User.wsp_default_request-rule): selected via match 'User.wsp_match_all' from processing policy 'User.wsp'
11:54:41 http debug 33491 10.57.129.63 0x81000171 Matching (User.wsp_match_all): Match: Received URL [/WebServiceProject/services/UsersCatalog] matches rule '*'
11:54:41 ws-proxy debug 33491 10.57.129.63 0x810000d6 wsgw (User.wsp): Match: Received value [http://www.datapower.com/fragment-id#dp.all()] matches WSDL component type 'fragmentid' 'getUserData'.
11:54:41 ws-proxy information 33491 10.57.129.63 0x80e00383 source-http (handler): WS-Proxy selected: 'User.wsp'. Operation 'getUserData' matches all criteria.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00384 source-http (handler): WS-Proxy User.wsp operation getUserName does not match SOAP operation as required by WS-I BP1.0/1.1 R2744 or R2745: received (getUserData) required (getUserName). Received protocol 'http://schemas.xmlsoap.org/wsdl/soap/', required protocol 'http://schemas.xmlsoap.org/wsdl/soap12/'. Received SOAPAction ((null)) required SOAPAction (). SOAPAction policy is lax.
11:54:41 ws-proxy warning 33491 10.57.129.63 0x80e004b8 source-http (handler): Unrecognized content type so SOAP Action header '' will be ignored
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00384 source-http (handler): WS-Proxy User.wsp operation setUserData does not match SOAP operation as required by WS-I BP1.0/1.1 R2744 or R2745: received (getUserData) required (setUserData). Received protocol 'http://schemas.xmlsoap.org/wsdl/soap/', required protocol 'http://schemas.xmlsoap.org/wsdl/soap12/'. Received SOAPAction ((null)) required SOAPAction (). SOAPAction policy is lax.
11:54:41 ws-proxy warning 33491 10.57.129.63 0x80e004b8 source-http (handler): Unrecognized content type so SOAP Action header '' will be ignored
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00384 source-http (handler): WS-Proxy User.wsp operation getUserData does not match SOAP operation as required by WS-I BP1.0/1.1 R2744 or R2745: received (getUserData) required (getUserData). Received protocol 'http://schemas.xmlsoap.org/wsdl/soap/', required protocol 'http://schemas.xmlsoap.org/wsdl/soap12/'. Received SOAPAction ((null)) required SOAPAction (). SOAPAction policy is lax.
11:54:41 ws-proxy warning 33491 10.57.129.63 0x80e004b8 source-http (handler): Unrecognized content type so SOAP Action header '' will be ignored
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00384 source-http (handler): WS-Proxy User.wsp operation getUserName does not match SOAP operation as required by WS-I BP1.0/1.1 R2744 or R2745: received (getUserData) required (getUserName). Received protocol 'http://schemas.xmlsoap.org/wsdl/soap/', required protocol 'http://schemas.xmlsoap.org/wsdl/soap/'. Received SOAPAction () required SOAPAction (). SOAPAction policy is lax.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e00384 source-http (handler): WS-Proxy User.wsp operation setUserData does not match SOAP operation as required by WS-I BP1.0/1.1 R2744 or R2745: received (getUserData) required (setUserData). Received protocol 'http://schemas.xmlsoap.org/wsdl/soap/', required protocol 'http://schemas.xmlsoap.org/wsdl/soap/'. Received SOAPAction () required SOAPAction (). SOAPAction policy is lax.
11:54:41 xmlparse debug 33491 request 10.57.129.63 0x80e003a9 xmlmgr (default): Parsing http://10.57.129.110:2912/WebServiceProject/services/UsersCatalog stopped on XPath match
11:54:41 xmlparse debug 33491 request 10.57.129.63 0x80e003a6 xmlmgr (default): Parsing document: 'http://10.57.129.110:2912/WebServiceProject/services/UsersCatalog'
11:54:41 xslt debug 33491 10.57.129.63 0x80a002ac xmlmgr (default): patterns Compilation Request: Found in cache expr:////*[local-name()='Envelope']/*[local-name()='Body']/*.
11:54:41 xslt debug 33491 10.57.129.63 0x80a002aa xmlmgr (default): patterns Compilation Request: Checking cache for URL 'expr:////*[local-name()='Envelope']/*[local-name()='Body']/*'.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e0037d source-http (handler): WS-Proxy User.wsp operation setUserData matches address (10.57.129.110:2912) url (/WebServiceProject/services/UsersCatalog). SOAP operation and Action will be evaluated.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e0037d source-http (handler): WS-Proxy User.wsp operation getUserName matches address (10.57.129.110:2912) url (/WebServiceProject/services/UsersCatalog). SOAP operation and Action will be evaluated.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e0037d source-http (handler): WS-Proxy User.wsp operation getUserData matches address (10.57.129.110:2912) url (/WebServiceProject/services/UsersCatalog). SOAP operation and Action will be evaluated.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e0037d source-http (handler): WS-Proxy User.wsp operation setUserData matches address (10.57.129.110:2912) url (/WebServiceProject/services/UsersCatalog). SOAP operation and Action will be evaluated.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e0037d source-http (handler): WS-Proxy User.wsp operation getUserName matches address (10.57.129.110:2912) url (/WebServiceProject/services/UsersCatalog). SOAP operation and Action will be evaluated.
11:54:41 ws-proxy debug 33491 10.57.129.63 0x80e0037d source-http (handler): WS-Proxy User.wsp operation getUserData matches address (10.57.129.110:2912) url (/WebServiceProject/services/UsersCatalog). SOAP operation and Action will be evaluated.
11:54:41 mpgw debug 33491 10.57.129.63 0x80e00140 source-http (handler): Generating chunked response stream to front
11:54:41 mpgw debug 33491 10.57.129.63 0x80e0013f source-http (handler): Found content length 207 HTTP input
11:54:41 mpgw debug 33491 10.57.129.63 0x80e0013b source-http (handler): HTTP Transaction # 1 on this TCP connection
11:54:41 mpgw information 33491 10.57.129.63 0x80e0013a source-http (handler): Received HTTP/1.1 POST for /WebServiceProject/services/UsersCatalog from 10.57.129.63
11:54:34 network debug 16865 response 10.57.129.63 0x80e0039f xmlfirewall (web-mgmt): url-open: Finished parsing response from: http://127.0.0.1:63503/
11:54:34 network debug 16865 response 10.57.129.63 0x80e0039e xmlfirewall (web-mgmt): url-open: response code 200
11:54:34 multistep debug 2996 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 multistep debug 2996 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 network debug 3968 response 10.57.129.63 0x80e0039f xmlfirewall (web-mgmt): url-open: Finished parsing response from: http://127.0.0.1:63503/
11:54:34 network debug 3968 response 10.57.129.63 0x80e0039e xmlfirewall (web-mgmt): url-open: response code 200
11:54:34 multistep debug 20309 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 multistep debug 20309 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 network debug 3968 response 10.57.129.63 0x80e0039f xmlfirewall (web-mgmt): url-open: Finished parsing response from: http://127.0.0.1:63503/
11:54:34 network debug 3968 response 10.57.129.63 0x80e0039e xmlfirewall (web-mgmt): url-open: response code 200
11:54:34 multistep debug 20293 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 multistep debug 20293 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 network debug 3968 response 10.57.129.63 0x80e0039f xmlfirewall (web-mgmt): url-open: Finished parsing response from: http://127.0.0.1:63503/
11:54:34 network debug 3968 response 10.57.129.63 0x80e0039e xmlfirewall (web-mgmt): url-open: response code 200
11:54:34 multistep debug 20277 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 multistep debug 20277 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 network debug 3952 response 10.57.129.63 0x80e0039f xmlfirewall (web-mgmt): url-open: Finished parsing response from: http://127.0.0.1:63503/
11:54:34 network debug 3952 response 10.57.129.63 0x80e0039e xmlfirewall (web-mgmt): url-open: response code 200
11:54:34 multistep debug 2964 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:34 multistep debug 2964 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:33 network debug 16817 response 10.57.129.63 0x80e0039f xmlfirewall (web-mgmt): url-open: Finished parsing response from: http://127.0.0.1:63503/
11:54:33 network debug 16817 response 10.57.129.63 0x80e0039e xmlfirewall (web-mgmt): url-open: response code 200
11:54:33 multistep debug 20245 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:33 multistep debug 20245 request 0x80c00004 xmlfirewall (map): Protocol layer did not supply content-type
11:54:33 network debug 16817 response 10.57.129.63 0x80e0039f xmlfirewall (web-mgmt): url-open: Finished parsing response from: http://127.0.0.1:63503/
这部分是我认为最重要的部分:
11:54:41 ws-proxy error 33491 error 10.57.129.63 0x01130006 wsgw (User.wsp): Failed to establish a backside connection
11:54:41 ws-proxy error 33491 10.57.129.63 0x80e00126 wsgw (User.wsp): Valid backside connection could not be established: Failed to establish a backside connection, url: http://10.57.129.63:2911/WebServiceProject/services/UsersCatalog
11:54:41 ws-proxy error 33491 10.57.129.63 0x80e00627 wsgw (User.wsp): Error occurred (port error) when connecting to URL 'http://10.57.129.63:2911/WebServiceProject/services/UsersCatalog'
11:54:41 network error 33491 0x80e00049 xmlmgr (default): Host connection failed to establish: 10.57.129.63 : tcp port 2911
11:54:41 network error 33491 0x00b30009 xmlmgr (default): Host connection could not be established
我问我的管理员我们的防火墙是否阻止了传入流量,但是允许它。
我发现DataPower接受请求,但它无法使它成为托管(Tomcat)的方式。
我认为它可能是VM网络设置的问题,但它在桥接和仅主机上都会引发相同的错误。
答案 0 :(得分:0)
您拒绝连接,这很可能意味着您已经遇到了防火墙。 使用DataPower中的故障排除工具对您需要连接的端口和IP进行连接测试,并检查是否已建立连接。 如果您这样做,那么您在Java服务上遇到了一些问题。 如果没有,则检查DataPower和目标服务器之间的任何防火墙和路由。
如果您使用多个IP / NIC,请确保在DataPower中正确设置了NIC。只有一个NIC应该有一个默认网关,其余的静态路由。