@ -37,6 +37,8 @@ import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode ;
import javax.xml.rpc.ParameterMode ;
import javax.xml.rpc.ServiceException ;
import javax.xml.rpc.ServiceException ;
import javax.xml.rpc.encoding.XMLType ;
import javax.xml.rpc.encoding.XMLType ;
import java.net.MalformedURLException ;
import java.net.URL ;
import java.net.URLEncoder ;
import java.net.URLEncoder ;
import java.rmi.RemoteException ;
import java.rmi.RemoteException ;
import java.text.SimpleDateFormat ;
import java.text.SimpleDateFormat ;
@ -63,7 +65,7 @@ public class MessageSubscriptionController {
private ConfigProp configProp ;
private ConfigProp configProp ;
private static final org . slf4j . Logger logger = LoggerFactory . getLogger ( MessageSubscriptionController . class ) ;
private static final org . slf4j . Logger logger = LoggerFactory . getLogger ( MessageSubscriptionController . class ) ;
@PostMapping ( "/subscription" )
@PostMapping ( "/subscription" )
public WeaResult < String > subscription ( @RequestParam Map < String , Object > param , @RequestBody Map < String , Object > params ) throws ServiceException , RemoteException {
public WeaResult < String > subscription ( @RequestParam Map < String , Object > param , @RequestBody Map < String , Object > params ) throws ServiceException , RemoteException , MalformedURLException {
logger . error ( "MessageSubscriptionController Start " ) ;
logger . error ( "MessageSubscriptionController Start " ) ;
String jtzhkey = "t6kj9c07jr" ;
String jtzhkey = "t6kj9c07jr" ;
// String jtzhadmin = configProp.getJtzhadmin();
// String jtzhadmin = configProp.getJtzhadmin();
@ -82,7 +84,7 @@ public class MessageSubscriptionController {
return WeaResult . success ( map . toString ( ) ) ;
return WeaResult . success ( map . toString ( ) ) ;
}
}
private void sendMsg ( Map < String , Object > params ) throws RemoteException , ServiceException {
private void sendMsg ( Map < String , Object > params ) throws RemoteException , ServiceException , MalformedURLException {
// logger.error("sendMsg params " + params);
// logger.error("sendMsg params " + params);
String systemId = "SYS006" ;
String systemId = "SYS006" ;
String password = "123456" ;
String password = "123456" ;
@ -93,8 +95,13 @@ public class MessageSubscriptionController {
String mobileurl = String . valueOf ( params . get ( "h5Url" ) ) ;
String mobileurl = String . valueOf ( params . get ( "h5Url" ) ) ;
// String pcurl = configProp.getPc_url()+ URLEncoder.encode(url);
// String pcurl = configProp.getPc_url()+ URLEncoder.encode(url);
// String msgurl = configProp.getPc_url()+ URLEncoder.encode(mobileurl);
// String msgurl = configProp.getPc_url()+ URLEncoder.encode(mobileurl);
String pcurl = url ;
String pcurl = configProp . getHtportaloaUrl_pc_url ( ) + new URL ( url ) . getPath ( ) ;
String msgurl = mobileurl ;
String msgurl = configProp . getHtportaloaUrl_pc_url ( ) + new URL ( mobileurl ) . getPath ( ) ;
logger . error ( " url: " + url ) ;
logger . error ( " pcurl: " + pcurl ) ;
String m_msgtitle = String . valueOf ( params . get ( "title" ) ) ;
String m_msgtitle = String . valueOf ( params . get ( "title" ) ) ;
String sendid = String . valueOf ( params . get ( "senderId" ) ) ;
String sendid = String . valueOf ( params . get ( "senderId" ) ) ;
@ -194,7 +201,8 @@ public class MessageSubscriptionController {
String typeNamespace = "http://message.ht_portal_webservice.com" ;
String typeNamespace = "http://message.ht_portal_webservice.com" ;
// String endpoint = "https://sappop.htgd.com.cn:50001/XISOAPAdapter/MessageServlet?senderParty=&senderService=BS_HTU_POP&receiverParty=&receiverService=&interface=SI_HTPortalMessage_OUT&interfaceNamespace=http%3A%2F%2Fhengtong.com%2FHTU%2FHTPortalMessage";
// String endpoint = "https://sappop.htgd.com.cn:50001/XISOAPAdapter/MessageServlet?senderParty=&senderService=BS_HTU_POP&receiverParty=&receiverService=&interface=SI_HTPortalMessage_OUT&interfaceNamespace=http%3A%2F%2Fhengtong.com%2FHTU%2FHTPortalMessage";
String endpoint = "http://sappod.hengtong.com:50000/XISOAPAdapter/MessageServlet?senderParty=&senderService=BS_HTU&receiverParty=&receiverService=&interface=SI_HTPortalMessage_OUT&interfaceNamespace=http%3A%2F%2Fhengtong.com%2FHTU%2FHTPortalMessage" ;
// String endpoint = "http://sappod.hengtong.com:50000/XISOAPAdapter/MessageServlet?senderParty=&senderService=BS_HTU&receiverParty=&receiverService=&interface=SI_HTPortalMessage_OUT&interfaceNamespace=http%3A%2F%2Fhengtong.com%2FHTU%2FHTPortalMessage";
String endpoint = configProp . getMessage_url ( ) ;
Service service = new Service ( ) ;
Service service = new Service ( ) ;
Call call = ( Call ) service . createCall ( ) ;
Call call = ( Call ) service . createCall ( ) ;
call . setTimeout ( 300000 ) ;
call . setTimeout ( 300000 ) ;
@ -215,10 +223,10 @@ public class MessageSubscriptionController {
}
}
headers . put ( "Authorization" , configProp . getUrl_password ( ) ) ;
headers . put ( "Authorization" , configProp . getUrl_password ( ) ) ;
// logger.error(" Url_password(): " + configProp.getUrl_password());
logger . error ( " Url_password(): " + configProp . getUrl_password ( ) ) ;
// logger.error(" systemId: " + systemId);
logger . error ( " systemId: " + systemId ) ;
// logger.error(" password: " + password);
logger . error ( " password: " + password ) ;
// logger.error(" moudule: " + moudule);
logger . error ( " moudule: " + moudule ) ;
logger . error ( " messages: " + messages ) ;
logger . error ( " messages: " + messages ) ;
Object [ ] val = new Object [ ] { systemId , password , moudule , messages } ;
Object [ ] val = new Object [ ] { systemId , password , moudule , messages } ;