Web services JBoss无法访问远程IP上的web服务

Web services JBoss无法访问远程IP上的web服务,web-services,jboss,wsdl,localhost,Web Services,Jboss,Wsdl,Localhost,我一直在研究这个问题,但似乎找不到问题所在。也许你可以帮我,如果帖子有点长,我道歉,因为我已经尝试控制所有的错误源 我开发了两个web服务,它们运行在Amazon上的远程服务器上,这些服务可以通过它们的http地址直接访问,我可以使用SoapUI向它们发出请求 我有一个使用这些服务的应用程序,我在同一台机器上用服务和消费应用程序在本地进行了尝试,效果很好。但是,当这些服务位于远程主机上时,应用程序根本无法访问它们,即使我从零开始添加它们,以便从远程IP消费。我得到一个错误: 警告[org.apa

我一直在研究这个问题,但似乎找不到问题所在。也许你可以帮我,如果帖子有点长,我道歉,因为我已经尝试控制所有的错误源

我开发了两个web服务,它们运行在Amazon上的远程服务器上,这些服务可以通过它们的http地址直接访问,我可以使用SoapUI向它们发出请求

我有一个使用这些服务的应用程序,我在同一台机器上用服务和消费应用程序在本地进行了尝试,效果很好。但是,当这些服务位于远程主机上时,应用程序根本无法访问它们,即使我从零开始添加它们,以便从远程IP消费。我得到一个错误:

警告[org.apache.cxf.phase.PhaseInterceptorChain]EJB默认值-1 {}ConsultarEstado{http:/ /servicios.cA.com/}consultar抛出异常,正在解除:org.apache.cxf.interceptor.Fault:无法发送消息

显然,它试图在本地主机上联系到它们,而本地主机并不存在。我用

<subsystem xmlns="urn:jboss:domain:webservices:1.2">
            <modify-wsdl-address>true</modify-wsdl-address>
            <wsdl-host>X.X.X.X</wsdl-host>
            <wsdl-port>8080</wsdl-port>
            <endpoint-config name="Standard-Endpoint-Config"/>
            <endpoint-config name="Recording-Endpoint-Config">
                <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
                </pre-handler-chain>
            </endpoint-config>
            <client-config name="Standard-Client-Config"/>
        </subsystem>
老实说,我不知道还需要修改什么才能让它正常工作

下面是一个服务wsdl定义

    ?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://servicios.cometeAlguito.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="ConsultarEstado" targetNamespace="http://servicios.cometeAlguito.com/">
  <wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://servicios.cometeAlguito.com/" elementFormDefault="unqualified" targetNamespace="http://servicios.cometeAlguito.com/" version="1.0">

  <xs:element name="consultar" type="tns:consultar"/>

  <xs:element name="consultarResponse" type="tns:consultarResponse"/>

  <xs:element name="recibo" type="tns:recibo"/>

  <xs:complexType name="consultar">
    <xs:sequence/>
  </xs:complexType>

  <xs:complexType name="consultarResponse">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:recibo"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="recibo">
    <xs:sequence>
      <xs:element minOccurs="0" name="combo" type="xs:string"/>
      <xs:element minOccurs="0" name="hora" type="xs:string"/>
      <xs:element minOccurs="0" name="nombreCliente" type="xs:string"/>
      <xs:element minOccurs="0" name="numOrden" type="xs:string"/>
      <xs:element minOccurs="0" name="producto" type="xs:string"/>
      <xs:element minOccurs="0" name="telefono" type="xs:string"/>
      <xs:element minOccurs="0" name="total" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

</xs:schema>
  </wsdl:types>
  <wsdl:message name="consultarResponse">
    <wsdl:part element="tns:consultarResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="consultar">
    <wsdl:part element="tns:consultar" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="ConsultarEstado">
    <wsdl:operation name="consultar">
      <wsdl:input message="tns:consultar" name="consultar">
    </wsdl:input>
      <wsdl:output message="tns:consultarResponse" name="consultarResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="ConsultarEstadoSoapBinding" type="tns:ConsultarEstado">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="consultar">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="consultar">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="consultarResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="ConsultarEstado">
    <wsdl:port binding="tns:ConsultarEstadoSoapBinding" name="ConsultarEstadoPort">
      <soap:address location="http://X.X.X.X:8080/cAClienteWEB/ConsultarEstado/ConsultarEstado"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

好吧,以防有人陷入同样的境地


在放置web服务的远程主机上,应该修改Standalone.xml…

若要解决此错误,请将用于修改wsdl地址的jboss配置从true更改为false,这将解决此问题

实际上,Jboss基于此设置修改wsdl位置,使其无法到达该地址

System.out.println(service.getWSDLDocumentLocation());
    ?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://servicios.cometeAlguito.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="ConsultarEstado" targetNamespace="http://servicios.cometeAlguito.com/">
  <wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://servicios.cometeAlguito.com/" elementFormDefault="unqualified" targetNamespace="http://servicios.cometeAlguito.com/" version="1.0">

  <xs:element name="consultar" type="tns:consultar"/>

  <xs:element name="consultarResponse" type="tns:consultarResponse"/>

  <xs:element name="recibo" type="tns:recibo"/>

  <xs:complexType name="consultar">
    <xs:sequence/>
  </xs:complexType>

  <xs:complexType name="consultarResponse">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:recibo"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="recibo">
    <xs:sequence>
      <xs:element minOccurs="0" name="combo" type="xs:string"/>
      <xs:element minOccurs="0" name="hora" type="xs:string"/>
      <xs:element minOccurs="0" name="nombreCliente" type="xs:string"/>
      <xs:element minOccurs="0" name="numOrden" type="xs:string"/>
      <xs:element minOccurs="0" name="producto" type="xs:string"/>
      <xs:element minOccurs="0" name="telefono" type="xs:string"/>
      <xs:element minOccurs="0" name="total" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

</xs:schema>
  </wsdl:types>
  <wsdl:message name="consultarResponse">
    <wsdl:part element="tns:consultarResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="consultar">
    <wsdl:part element="tns:consultar" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="ConsultarEstado">
    <wsdl:operation name="consultar">
      <wsdl:input message="tns:consultar" name="consultar">
    </wsdl:input>
      <wsdl:output message="tns:consultarResponse" name="consultarResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="ConsultarEstadoSoapBinding" type="tns:ConsultarEstado">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="consultar">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="consultar">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="consultarResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="ConsultarEstado">
    <wsdl:port binding="tns:ConsultarEstadoSoapBinding" name="ConsultarEstadoPort">
      <soap:address location="http://X.X.X.X:8080/cAClienteWEB/ConsultarEstado/ConsultarEstado"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>