I am working in a list which contains around 300 different fields. I have also added another list as second data connection. Everything is perfect at this stage and i am able to publish successfully. After that i have given a action rule as Set Field Value to copy fields from the second data connection to Main data connection. Now i am not able to save the form and publish the same. I am getting "SOAP error when publishing Infopath form to Sharepoint" without any further description. If i disable the rule, then its published successfully. Since the above rule is necessary to copy data, i cannot disable the rule. Kindly help me to fix this issue.
300 Fields means you have created 300 columns in the Sharepoint list. That's pretty extreme for a sharepoint list. Especially since data will populate those fields. SOAP errors in infopath are generally a timeout with communicating between Infopath and the Sharepoint server, which means when you click publish it goes through each field in infopath and writes it in sharepoint. I have similar issues with a 250 field infopath form and I have begun to sacrifice lesser needed fields. If you have access to the farm you can try extending the timeout which I believe is defaulted at 5 minutes. Also from my experience Infopath takes especially long with calculated sharepoint fields, for me more than 3 is a deal breaker.
One possible problem maybe, the "Main Connection" is a receive data connection and so you are not able to change the values of this data.
Though you can create data connections that submit data to a list which you could use, you would just need to create another data connection that submits data to the same list as the "Main Connection".
Hope this helps!